Embed Soundcloud New

finds link to song on soundcloud and automatically embeds into the page

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name           Embed Soundcloud New
// @namespace      my
// @description    finds link to song on soundcloud and automatically embeds into the page
// @include        *torrentsmd.*
// @require        http://code.jquery.com/jquery-2.1.3.js
// @version 0.0.1.20150205173048
// ==/UserScript==
var soundcloud = $("a").filter(function() {
    var regex = /(\bhttps?:\/\/soundcloud.com\/+([a-zA-Z0-9\/]*))/g;									
    return regex.test( $(this).attr("href") );
});
soundcloud.each(function(){	
    var song = $(this).attr("href");
    var embed = '';
    embed += '<object height="81" width="100%">';
    embed += '<param name="movie" value="http://player.soundcloud.com/player.swf?url='+song+'&amp;g=bb"></param>';
    embed += '<param name="allowscriptaccess" value="always"></param>';
    embed += '<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url='+song+'&amp;g=bb" type="application/x-shockwave-flash" width="100%">';
    embed += '</embed>';
    embed += '</object>';
    $(this).after( embed );
});