Greasemonkey script to fix SourceForge download links


First, background: Greasemonkey is a FireFox plugin that lets you add bits of DHTML (“user scripts”) to any webpage
to change its behavior or content. It’s the Javascript equivalent of
user CSS styles.

SourcePlease
is a GreaseMonkey script I wrote to avoid having to click through two
pages of mirror lists (and then be prompted for a file location) when
you encounter a SourceForge
download URL. It rewrites the URL to point directly to the file on a
random mirror (unless a mirror is specified in the URL), ready to be
clicked or copied-and-pasted or whatever you like.

Tell your SourceForge-frustrated friends!


9 responses to “Greasemonkey script to fix SourceForge download links”

  1. If you’re a paid SourceForge subscriber, one of the “perks” is a direct-download link. I guess SourcePlease will be useful for those folks who aren’t subscribers, though. Cool!

  2. But the links aren’t written that way from the website, you still have to construct them yourself. It’s mostly good for batch downloading and things like that, according to their documetnation (unless they’ve changed something in the past 3 months)

  3. Actually, you do — from the “Files” section on a SF project, if you’re a subscriber, it puts a little “[direct download]” hyperlink next to the file. It’s quite convenient for automating file pulls from SF projects, and the like.

  4. Interesting. That was the last place I was thinking of when I threw this together, though, because there you’re at least prepared to go through the additional steps. What gets me every time is when a project’s website has a link that looks like it downloads a package, and you copy the link (that ends in “.tar.gz” or “.rpm” even!) and paste it into a wget command on the remote box you’re working on, and you get an HTML page.

    Flooterbuck‘s page is the example I kept testing on (see the download link), although it’s even worse when the website you’re looking at isn’t in the SourceForge domain.

  5. But if you link directly to the mirror, I think SF’s download count stats won’t be accurate (may not be a big deal for you).