Beruflich Dokumente
Kultur Dokumente
// version 1.0
// 2009-07-17
// Copyright (c) 2008, Irfan Ahmad
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// 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 "Slideshare Downloader", and click Uninstall.
//
// --------------------------------------------------------------------
//
// Change Log:
//
// 1.0: This is the final release. Please use www.slidzy.com to download slides.
// 0.5 BETA: Fixed it again. This time trying a permanent solution
// 0.43 BETA: I am tired of changing class name daily :S Looking for a better
solution.
// 0.42 BETA: Yet another change in class name.
// 0.41 BETA: Minor change in class name of download not available text. Fixed !
// 0.4 BETA: Slideshare changed the classname of "Download not available" text
again. Cant understand why they are changing is so rapidly.
// 0.3 BETA: Slideshare again changed the location of the doc variable, now it is
part of slideshare_object.
// 0.2 BETA: Fixed the the script to work with updated DOM of slideshare.net (They
had changed the location of Download not Available text)
//
//
// ==UserScript==
// @name Slideshare Downloader
// @namespace http://iffee.wordpress.com/2008/07/27/how-to-download-slideshare-
slides/
// @description This script enables a download option on all slideshare slides
which have their download option disabled
// @include http://www.slideshare.net/*
// @include http://slideshare.net/*
// ==/UserScript==
// declaring namespace
window.Irfan = {};
window.Irfan.lnkDownload = document.evaluate(
"//li[@class='action-download']",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
window.Irfan.lnkContainer = document.evaluate(
"//ul[@class='slideviewActions h-tools']",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
document.getElementById('lnkDownload_slidzy').addEventListener('click',function(){
document.location = 'http://www.slidzy.com/download/?url=' +
document.location;
},false);
document.getElementById('lnkDownload_irfan').addEventListener('click',function(){
if(!GM_xmlhttpRequest) {
alert("Your version of Greasemonkey is old. Please upgrade it.");
return false;
}
// making XHR
GM_xmlhttpRequest({
method: 'GET',
url: window.Irfan.xmlURL,
onload: function(response) {
// parsing the xml to extract all slide links
var p = new DOMParser();
var xmldoc =
p.parseFromString(response.responseText,"application/xml");
var slides = xmldoc.getElementsByTagName("Slide");
links.appendChild(lnk);
}
downloadAllLink.appendChild(document.createTextNode("DownloadThemAll"));
var help = document.createElement("p");
help.appendChild(document.createTextNode("Use some tool
like "));
help.appendChild(downloadAllLink);
help.appendChild(document.createTextNode(" to download all
slides."));
var w =
window.open("","ss_downloadlinks","toolbar=0,menubar=0,resizable=0,scrollbars=1,wid
th=400,height=300");
w.document.body.appendChild(slidesCount);
w.document.body.appendChild(help);
w.document.body.appendChild(links);
}
});
},false);
}
else if(window.Irfan.lnkAlreadyDownload.snapshotLength != 1)
{
alert("Error!\nPlease report it to http://iffee.wordpress.com/2008/07/27/how-
to-download-slideshare-slides/");
}