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!

Comments 9

  1. citizenx wrote:

    This is what lazy-as-virtue is about, sir. Well done.

    Posted 16 Mar 2005 at 11:15 pm
  2. zhixel wrote:

    RAGH YES

    Posted 17 Mar 2005 at 1:15 am
  3. brad wrote:

    YES!!@!

    Posted 17 Mar 2005 at 2:00 am
  4. dossy wrote:

    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!

    Posted 17 Mar 2005 at 12:11 pm
  5. crschmidt wrote:

    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)

    Posted 17 Mar 2005 at 7:19 pm
  6. dossy wrote:

    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.

    Posted 17 Mar 2005 at 10:19 pm
  7. crschmidt wrote:

    Hm. I never noticed that when I first became a subscriber. I wonder if it’s new, or if I just missed it.

    Posted 18 Mar 2005 at 6:32 am
  8. Rich wrote:

    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.

    Posted 18 Mar 2005 at 10:03 am
  9. dossy wrote:

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

    Posted 18 Mar 2005 at 10:06 am