Created
September 16, 2009 07:08
-
-
Save kurumigi/187910 to your computer and use it in GitHub Desktop.
[GM script]yam Downloader
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
// ==UserScript== | |
// @name yam Downloader | |
// @namespace http://d.hatena.ne.jp/kurumigi/ | |
// @description Download flv or mp3 files from http://mymedia.yam.com/ | |
// @include http://mymedia.yam.com/m/* | |
// ==/UserScript== | |
(function () { | |
GM_xmlhttpRequest({ | |
method: "GET", | |
url: location.href.replace("http://mymedia.yam.com/m/","http://mymedia.yam.com/api/a/?pID="), | |
onload: function (httpObj) { | |
if (httpObj.responseText.match(/(furl|mp3file)=(http:\/\/.*?\.(mp3|flv))(&|$)/)) { | |
var title = document.evaluate("//h1[@class='heading']/span[1]", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null); | |
title.singleNodeValue.innerHTML = '<a href="' + RegExp.$2 + '">' + title.singleNodeValue.innerHTML + '</a>'; | |
} | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment