Created
July 25, 2009 06:42
-
-
Save jazzido/154720 to your computer and use it in GitHub Desktop.
Rapidshare Reminder -- Session expirations, no more!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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