This Mobile Life

By Matt K Last update Oct 19, 2009 — Installed 1,436 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 1, 0, 0, 0, 0, 2, 1, 3, 1, 1, 1, 2, 0, 3, 1, 3, 0

There are 5 previous versions of this script.

// This Mobile life
// version 0.5 GAMA-HEXATRON
// 2009-10-19
// Copyright (c) 2009, Matt Katz
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: https://addons.mozilla.org/en-US/firefox/addon/748
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "This Mobile Life", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          This Mobile Life
//@author         Matt Katz
// @namespace     http://www.morelightmorelight.com
// @description   Changes all This American Life mp3 stream links to link to the .mp3 file to download
// @include       http://*.thislife.org/*
// @include       http://thislife.org/*
//@require http://usocheckup.dune.net/2392.js
// ==/UserScript==





var allLinks = unsafeWindow.document.getElementsByTagName("a");

for (i = 0; i < allLinks.length; i++)
{ 
 
  var href = allLinks[i].href;
  if (href.match(/javascript\:playMe\(([0-9]+)\);$/i) )
  {
//   alert('Hello world!');
   var episode = href.match(/([0-9]+)/i);
   
   //get the number to get the episode number
  if(episode){
    allLinks[i].setAttribute("href", "http://audio.thisamericanlife.org/jomamashouse/ismymamashouse/" + episode[1] + ".mp3");
   }
   
   
  }
}