Syndic8 Feed Finder Plugin For Greasemonkey
Yesterday I wrote up some of my thoughts on the Greasemonkey extension to Firefox. Today I would like to followup by walking you through a little script that I wrote myself.
The script was written to simplify the process of finding and suggesting feeds to my Syndic8 site. One of the principles of our feed collection is that we want it to reflect actual site usage and readership by real people. We don’t necessarily want every feed in existence, but we would like to have as many of those that people are actually looking at. For a while I have wanted to create some kind of browser accessory that would make it easier to collect this information. When I saw Greasemonkey a month or two ago, I decided to write a script to do what I wanted.
The script is called find_feeds.user.js ; you will need to have Greasemonkey installed before you can use it. Load the script into a browser window, then select “Install This User Script…” from the Tools menu. Click the OK button when the installation dialog pops up, and you are ready to go.
Here’s a sample session, based on real-world usage. I was reading Scripting News this morning and saw a link to an item in Om Malik’s blog:
I clicked on the link to visit Om’s blog. The Feed Finder sprung in to action. It scanned the HTML (using the DOM) for “link rel” tags per the RSS and Atom autodiscovery standards, and then made an asychronous, background call to a web service at Syndic8. This service accepts any number of feed URLs and returns 3 lists: known, unknown, and unwanted. The feed finder takes the list of unknown feeds and creates a little popup window, like this:
At this point I can choose to suggest the feeds to Syndic8 (in the current tab or in a new tab) or I can ignore them. I’ll suggest them in a new tab:
Syndic8 enters the feeds into the database, and we are good to go:
As soon as I pressed the “Suggest Feeds to Syndic8 (New Tab)” button, the Feed Finder hid itself:
So there you have it. The current version of the Feed Finder consists of just 406 lines of JavaScript. I’ve probably invested 8 hours into it so far, not a big deal considering what I’ve built.