代码之家  ›  专栏  ›  技术社区  ›  Metro

与VS2008起始页一起使用的StackOverflow atom提要

  •  3
  • Metro  · 技术社区  · 17 年前

    是否有StackOverflow的URL,我可以在VS startpage上使用它来代替从未更新过的MS页面?可以在工具上设置VS使用的URL->选项::启动对话框。

    我试过了 https://stackoverflow.com/feeds VS投诉有以下错误:

    当前的新闻频道可能不是 有效的RSS源或您的internet 连接可能不可用。到 在工具上更改新闻频道 菜单,单击选项,然后展开 环境,然后单击启动。

    4 回复  |  直到 9 年前
        1
  •  2
  •   Community Mohan Dere    9 年前

    看来 https://stackoverflow.com/feeds

    您可能需要创建一个中介并将atom转换为rss。

        2
  •  2
  •   Community Mohan Dere    9 年前

    https://stackoverflow.com/tags/vs2008 是一个我会选择-保持在最前沿的vs2k8相关问题

    -我不知道为什么这被否决了-URL对这是有效的。

    https://stackoverflow.com/feeds/tag/vs2008 .

        3
  •  2
  •   Scott Dillman    17 年前

    这是我对这个问题的不那么优雅的解决办法。。

    您需要访问php服务器。

    feed需要从atom转换为RSS,这里有一个非常好的xsl样式表,符合要求: http://atom.geekhood.net/ ,具体而言: http://atom.geekhood.net/atom2rss.xsl

    <link xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" rel="replies" type="application/atom+xml" href="http://stackoverflow.com/feeds/question/204696/answers" thr:count="5" />
    

    要解决这个问题,请转到样式表的末尾,像我所做的那样注释掉以下副本:

    <!-- copy extensions -->
    <x:template match='*'>
        <x:comment>Unknown element <x:value-of select="local-name(.)"/></x:comment>
    <!--    
        <x:copy>
            <x:copy-of select='node()|@*'/>
        </x:copy>
    -->
    </x:template>
    

    现在,在php服务器上创建一个包含以下内容的php文件:

    <?php
    
    $url=$_GET['url'];
    
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $content = curl_exec($ch);
    curl_close($ch);
    
    $chan = new DOMDocument(); 
    $chan->loadXML($content);  
    $sheet = new DOMDocument(); 
    $sheet->load('atom2rss.xsl'); 
    $processor = new XSLTProcessor();
    $processor->registerPHPFunctions();
    $processor->importStylesheet($sheet);
    $result = $processor->transformToXML($chan); 
    
    echo $result;
    
    ?>
    

    现在在VS中,您可以将新的starpage url添加为:

    http://yourserver.com/file.php?http://stackoverflow/feeds

    哪里 是您的域和 file.php 是包含上面php内容的文件。。。

        4
  •  0
  •   Community Mohan Dere    9 年前

    尝试主页的RSS源: https://stackoverflow.com/feeds

    :哎哟,正如评论正确指出的那样,看起来这是一个ATOM提要而不是RSS提要,我应该在发布之前仔细检查一下!我试着通过FeedBurner运行提要,将其转换为RSS,但VS仍然不喜欢它。奇怪的是,当我将FeedBurner提要输出保存为静态XML文件并在本地提供时,VS没有问题!

    我已经玩了一段时间,现在无法找到一个解决办法。我不知道VS到底不喜欢什么(可能是一些与头相关的东西),但我猜这唯一可行的方法是,如果SO在他们的末端实现了一些东西,或者有人编写了一个代理。

    重新编辑

    推荐文章