Skip to content

Instantly share code, notes, and snippets.

@jazzido
Created July 25, 2009 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jazzido/154720 to your computer and use it in GitHub Desktop.
Save jazzido/154720 to your computer and use it in GitHub Desktop.
Rapidshare Reminder -- Session expirations, no more!
var notif = jetpack.notifications.show;
var statusWidget = null;
var widget = {
html: '<span></span>',
width: 20,
onReady: function(w) {
statusWidget = $(w);
statusWidget.span = statusWidget.find('span');
}
};
var showCountDown = function(start) {
statusWidget.span.html(start);
if (start > 0) setTimeout(showCountDown, 1000, start-1);
else {
notif("Your download is ready!");
}
}
var onDocLoaded = function(doc) {
if (doc.location.href.match('rapidshare.com')) {
var z = $(doc).find('h3#zeit');
if (z.length > 0) {
var time = z[0].innerHTML.match(/([0-9]+)/)[1];
showCountDown(time);
}
}
};
jetpack.tabs.onReady(onDocLoaded);
jetpack.statusBar.append(widget);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment