From: Antonio Ospite Date: Fri, 5 Apr 2013 13:30:03 +0000 (+0200) Subject: Add support for slideshare.net X-Git-Url: https://git.ao2.it/GM_direct_download_links.git/commitdiff_plain/HEAD Add support for slideshare.net The URL to the XML file listing the resources is provided. Signed-off-by: Antonio Ospite --- diff --git a/direct_download_links.user.js b/direct_download_links.user.js index d1c1e52..f9d51e1 100644 --- a/direct_download_links.user.js +++ b/direct_download_links.user.js @@ -32,6 +32,8 @@ // @include http://www.rai.tv/* // @include http://soundcloud.com/* // @include http://www.telecinco.es/* +// @include http://slideshare.net/* +// @include http://www.slideshare.net/* // ==/UserScript== // @@ -128,6 +130,21 @@ var supported_sites = [ urlRegexp: /src="([^"]*)"/, linkDestXPath: '//div[@class="pg-bd"]', }, + { + locationRegexp: /^http:\/\/(www\.|)slideshare.net\/.*$/, + urlContainerXPath: '//script[@id="page-json"]', + urlRegexp: /"ppt_location":"([^"]*)"/, + processURL: function(site, object_id) { + var URL = 'http://s3.amazonaws.com/slideshare/' + object_id + '.xml'; + var evt = document.createEvent('Event'); + evt.initEvent('UrlFetched', true, true); + evt.site = site; + evt.URL = URL; + document.dispatchEvent(evt); + return; + }, + linkDestXPath: '//div[@class="playerWrapper"]', + }, ]; /* Apply different rules to different sites */