views:

466

answers:

4

Is there a URL for StackOverflow that I can use on the VS startpage in place of the never updated MS page? The URL that VS uses can be set on the Tools->Options::Startup dialog.

I've tried http://stackoverflow.com/feeds VS complaints with the following error:

The current news channel might not be a valid RSS feed, or your internet connection might be unavailable. To change the news channel, on the Tools menu, click Options, then expand Environment and click Startup.

+2  A: 

http://stackoverflow.com/tags/vs2008 is the one I'd pick - to keep relevant questions for vs2k8 at the forefront

edit - I don't know why this got downvoted - the URL is valid for SO.

If you're looking for a specific tag feed, you can grab something like http://stackoverflow.com/feeds/tag/vs2008.

warren
A: 

Try the RSS feed for the main page: http://stackoverflow.com/feeds

Edit: Whoops, as the comments rightly point out, looks like it's an ATOM feed not an RSS feed, I should have double checked before posting! I tried running the feed through FeedBurner to convert it to RSS but VS still doesn't like it. The odd thing is, when I saved the FeedBurner feed output as a static XML file and served it up locally, VS had no problem!

I've played around with this for a while now and cannot figure out a workaround. I don't know exactly what VS doesn't like (presumably something header-related) but I'm guessing the only way this is likely to work is if the SO guys implement something at their end, or somebody writes a proxy.

Edit again: It might actually be encoding related. Hmmm...

Luke Bennett
Something in either the feed or VS's page doesn't display that correctly.
Wayne
Looking at the feed's source, it is Atom for sure. (Which actually is superior to RSS, so I've heard.) Also, the W3C Markup Validator says the feed is totally okay. Maybe VS2008 is incapable of showing Atom? (BTW: Lots of readers just say they use RSS, but can read Atom as well.)
hangy
+2  A: 

It appears that http://stackoverflow.com/feeds is actually an atom feed and not rss so that is probably where the VS issue is coming from.

You may have to create an intermediary and transform the atom to rss.

Quintin Robinson
This won't necessarily work - see my answer.
Luke Bennett
@Luke - It's definately possible that you might not be able to use an existing solution and trust it's translation to generate valid VS friendly RSS. However I do think creating a custom XSLT and generating well formed RSS would do the trick, should a pre-built solution not work.
Quintin Robinson
+2  A: 

Here is my less that elegant solution to the problem..

You will need access to a php server.

The feed needs to be tranformed into RSS from atom, and there is a really good xsl stylesheet here that fits the bill: http://atom.geekhood.net/, specifically: http://atom.geekhood.net/atom2rss.xsl

There is one element in the feed that VS seems not to like:

<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" />

to get around this, go to the end of the stylesheet and comment out the following copy like I have done:

<!-- 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>

Now create a php file on your php server with the following content:

<?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;

?>

Now move the atom2rss.xsl file to the same dir as the php file you created..

Now in VS you can add the new starpage url as:

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

Where yourserver.com is your domain and file.php is the file with the php content from above...

Then you should be able to enjoy the RSS feed from Stackoverflow.com in you start page in Visual Studio, that is of course if you are into that kind of thing..

This assumes you are running PHP5 and have the php_curl.dll and php_xsl.dll enabled on the server..

Enjoy

ChalkTrauma