// ==UserScript== // @name PodOmatic // @description PodOmatic download URLs to Wget commands // @version 1.0 // @namespace http://www.adrian.kousz.ch/ // @require https://git.adrian.kousz.ch/adrian/userscripts/raw/master/lib.js // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js // @match http://*.podomatic.com/* // @grant none // ==/UserScript== AdiUserscriptLib.addButton('Wget Cmds', function () { var vars = {} var commandline = 'wget -cO "{name}.mp3" {url}\n' var commands = '' $('a.podcast-title').each(function () { divlinks = $(this).nextUntil('div.links').next() vars.url = divlinks.find('a:contains("Download")').attr('href') vars.name = $(this).text() commands += AdiUserscriptLib.interpolate(commandline, vars) }) var w = window.open(); w.document.write('
' + commands + '
') w.document.close() })