Search code examples
google-readersafari-extension

Google Reader Subscription URL


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.


Solution

  • 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.