youtubeã§è¦ãæ åãtwitterã«éãGreasemonkeyã¹ã¯ãªãã
ã»ã¨ãã©最速インターフェース研究会 :: livedoor Readerで今読んでいるフィードをTwitterに送るGreasemonkeyスクリプトãã®ã¾ã¾ã§ãããããªã®ãã¼ã¸éãã¦60ç§å¾ã«éãã¾ãã
// Copyright (C) 2005, koyachi. // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html // // ==UserScript== // @name youtube report to twitter. // @namespace http://d.hatena.ne.jp/koyachi/ // @include http://youtube.com/watch?v=* // @include http://www.youtube.com/watch?v=* // ==/UserScript== (function() { var w = (typeof unsafeWindow == "undefined") ? window : unsafeWindow; with (w) { function post_twitter(status){ GM_xmlhttpRequest({ method : 'POST', url: 'http://twitter.com/statuses/update.json', headers: { 'Content-type': 'application/x-www-form-urlencoded', }, data : 'status=' + status, onload : function(res) { GM_log('twittered!'); }, onerror: function(res) { var err = 'Failed - ' + res.status + ': ' + res.statusText; GM_log(err); }, }); } setTimeout(function(){ var url = document.location.href; var title = document.getElementById('video_title').innerHTML; post_twitter(encodeURIComponent(['Watching: "', title, '" ', url].join(''))); }, 60 * 1000); } })();