Adding an “Unsubscribe” button to Google Reader using Greasemonkey

Yesterday, Maki asked on Twitter, “I would love to have a ‘Quick unsubscribe’ button for Google Reader…a greasemonkey script would be terrific. Anyone wanna do one?” Of course, it seems I have a thing for hacking out little web toys for people I know on Twitter, so I gave it a whack.  Here’s the result:

Here’s a screenshot showing what it does:

Google Reader Unsubscribe button screenshot

It’s a pretty simple script. The hardest part was reverse-engineering Google Reader’s packed/minified JavaScript, but that wasn’t too hard.

Do you have a useful idea for a web toy? Perhaps if you run it by me and it interests me, I’ll hack on it for you, too.

Tags: , , ,

Comments

  1. This script may be dangerous.

    It appears that if you view items by tags, as I do, instead of viewing by single subscriptions, when you click the unsubscribe button, it may unsubscribe you from all of the feeds in that tag.

    I’m not sure though, because I was unwilling to test that.

  2. bfos7215: Thanks for the concern! When you say “by tags” do you mean folders? If you’re viewing a folder, and click the “Unsubscribe” button, it doesn’t seem to actually unsubscribe from anything.

    Perhaps it should unsubscribe you from the entire folder? Or, just the feed belonging to the entry that’s currently active?

    I’ve gone ahead and fixed the script to unsubscribe from the feed that belongs to the currently active entry in the reader. Thanks for the bug report.

  3. Yes, by “tags” I also mean “folders”. I’m still stuck using the original terminology Google Reader used. They use a picture of a folder, but they act as tags in that you can have a subscription in multiple tags/folders.

    I agree that it should only unsubscribe from the feed of the currently active item. My only question on that, is what does it do when there is no active item? Such as when I initially click on a feed. This is in list view. In expanded view, there will always be an active item.

  4. Also, you say you have modified the script to unsubscribe from the feed of the currently active item.

    I’ve re-installed the script by using the same link in this post. When I click unsubscribe, the verification pop-up asks “Are you sure you’d like to unsubscribe from [folder-name]”. I’m not ready to test this, but I would expect it to say the name of the feed, not the folder.

  5. Sorry for the clutter. But, I may have found another bug.

    When I try to subscribe to a new feed with your script turned on, there is no button for me to subscribe to the feed I am previewing. I turned off your script, and then the subscribe section/button displayed.

  6. bfos7215:

    re #3, if there is no currently active item, the script will use the first item in the list. I believe this is reasonable behavior.

    re #4, you may have downloaded the script before I actually uploaded the modified script. I’ve gone and added “Version 0.2” to the end of the script’s @description. Try re-downloading and installing again. The newest version of the script most definitely should display the actual feed name in the confirm dialogue.

    re #5, I’ll try to reproduce the behavior now and follow up with a comment. Thanks!

  7. Okay, I tested the feed subscription preview issue and with 2.0.0.12 on WinXP with Greasemonkey 0.7.20080121.0 and the Google Unsubscribe Button script 0.2, I get the “Subscribe Now” button in the feed subscription preview.

    After you update to version 0.2 of the Greasemonkey script, can you still reproduce the bug? If you can, please provide all the relevant version information so I can try to reproduce. Thanks!

  8. I’m not sure why, but I’m not getting .2 version of your script when I click the link to the script in this post.

    I’ve tried clearing my cookies and all of that. But, there’s no version in @description when I look at the code.

  9. bfos7215: Hmm. Cached in the browser, perhaps? Try clearing your cache …

  10. OK, I got the new version. Everything seems to work fine, now.

    In list view, if no item is open, the message says that it can’t identify the feed to unsubscribe from. I thought you said you wanted it to unsubscribe from the first feed. But, I actually like the functionality as it is.

    Or, better yet, is it possible to disable or hide the unsubscribe button if no item is open?

  11. I could try disabling the unsubscribe button, but it really ought to have picked up the first feed. That’s strange. Any tips on how to reproduce?

  12. I don’t really know what else to add.

    I clicked on a folder on the left with multiple feeds with unread items (I only view unread items). I am also in list view, as I said. I didn’t open any items before clicking unsubscribe.

    The other greasemonkey scrits that I have active are “Jasper’s Google Reader subscribe” and “Facebook Sharer + Google Reader”

  13. Aha, sorry! I was in “Expanded view”. When I switched to “List view” I was able to reproduce the problem. Unfortunately, I can’t do much about it–in the “List view” without the current item being expanded, there IS no feed information in the markup, which is necessary in order for my Greasemonkey script to issue the unsubscribe request. If you notice, clicking on “Folder settings” also won’t allow you to unsubscribe, either.

    I also don’t have a good way of enabling/disabling the “Unsubscribe” button, so the best I can do is present the error dialogue as it is now.

  14. Thanks for the script – i was hardly looking for something like that. Does it work with the latest modifications from google reader? I can’t seem to get to work within my fluid app.

  15. Frank: I haven’t updated the script to work with any recent changes in Google Reader. I’ll try to do that soon. Thanks for asking!

  16. *bump* update would be awesome 🙂
    keep on the good work.

    i put your script on mento and the crowd seems to like it:
    http://www.mento.info/dotdean/archive/69308

    grettings from germany

  17. Script sounds awesome but appears not to be working. Is that because of the changes to Google Reader mentioned above? Cheers.

Speak Your Mind

*