views:

47

answers:

1

I'm trying to create a link that allows a user to subscribe to a feed directly in Google Reader (bypassing the iGoogle option). I've tried several target URLs:

Each seems to work as expected most of the time, but I've bumped into a couple of feeds that don't. The deviating factor seems to be that the URLs that don't work all have a query string of their own. One example is http://majicjungle.com/blog/?feed=atom.

What's even more strange to me is that these seem to work the very first time I try to subscribe, but if I close the window and return to the same URL, it doesn't. I'm encoding the feed URI before redirection so I have:

window.location.replace( 'http://www.google.com/reader/view/feed/' + encodeURIComponent( feed_uri ) );

The first time I redirect, I end up at http://www.google.com/reader/view/feed/http%3A%2F%2Fblog.squirrelapp.com%2F%3Ffeed%3Drss2 with the URI components encoded as expected. If I close that window and go through the exact same steps, though, I end up at http://www.google.com/reader/view/feed/http://blog.squirrelapp.com/?feed=rss2#stream/feed%2Fhttp%3A%2F%2Fblog.squirrelapp.com%2F.

Not only is the feed URL decoded, but there's also a very obvious redirection happening at the Google Reader end. This happens every time after the first. Has anyone else had this experience, know what's happening and/or know how to fix it?

I've been working the trial and error method (combined with many, many searches) for days now and I keep coming up on the error side of things. Any help or insight would be much appreciated.

A: 

Have you tried using the fragment version of the URL directly, e.g.:

http://www.google.com/reader/view/#stream/feed/http%3A%2F%2Fblog.squirrelapp.com%2F%3Ffeed%3Drss2

The unescaping of the URL is a Safari bug, since the same problem does not occur in Chrome or any other browser.

Mihai Parparita
Thanks, Mahai. Is this Safari bug documented anywhere that you know of (it might be useful to get additional details)? I honestly can't remember whether I tried the fragment URL version. I've tried a ton of URLs, but it's entirely possible that I didn't try that one. I'll do so and report back.
Rob Wilkerson
I get the same end result using the fragment directly as `http://www.google.com/reader/view/#stream/feed/ + encodeURIComponent( feed_uri )`.It moves pretty quickly, but from what I can tell, I access Reader with the correct URI, but am then immediately redirected once or twice and end up at a bad URL with the telltale "oops" message.
Rob Wilkerson