Ravelry Hack #1 - Counting downloads

So, I like Ravelry's designer pages. They're great for indulging my vanity. I tend to check my downloads every once in a while, just out of curiosity, to see if anyone's downloading my patterns.

But one thing it's lacking, and that I'm generally curious about, is how many times they've been downloaded in total. The page doesn't indulge that curiosity. I initially considered putting in a feature request, but then got sidetracked by geekery.

See, the Ravelry downloads page is remarkably readable HTML. Which led me to a quick and easy conclusion: I can fix this in Greasemonkey.

Even having forgotten most of what I learned about the Javascript HTML DOM last time I wrote a Greasemonkey script, it took just over two hours.

Becomes:

With added daily counts on the right-hand column and a "Total Downloads" field at the bottom of the graph.

Installation

If you are using Firefox without Greasemonkey, a compiled Firefox addon is available here. Download it, unzip it and drag it into your Firefox window. It should ask to install, like a normal add-on.

If you have Greasemonkey installed or are using Opera, download the Greasemonkey script file and install the user.js file by:

Firefox: by dragging the file into your Firefox window. Greasemonkey should open, displaying the affected URL and ask you if you wish to install.

Opera: The path where User Javascript files are loaded from is indicated in Preferences/Advanced/Content/Javascript Options. If no path is indicated, choose one. Place the user.js file into that directory.

0 comments: