タイトル・URLコピー系ブックマークレット

「タイトル」 URL(短縮しない)表示ブックマークレット

  • 「タイトル」 URL(短縮しない) をpromptで表示します。
javascript:var x=prompt('Copy this!','「' document.title '」 ' location.href);

「タイトル」 URL(bit.ly短縮)表示ブックマークレット

直接webのtwitterに投稿するブックマークレット。これがないとたぶんできなかった。
2010-03-07 - notes plastiques


僕は直接投稿じゃなくてコピーしたいのでちょっと改変してみました。

利用にはbitlyアカウントが必要ですので「http://bit.ly」でアカウントを作成してください。当然ながらtwitterアカウントも必要です。

そしたら

でbitlyのAPIkeyを取得してくだしあ。


注意!このブックマークレットの"http://bit.ly/javascript-api.js?version=latest&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07"のlogin=〜とapiKey=〜の部分は先程取得しましたbitlyのapikeyに書き換えてください!

javascript:var%20JSLoader=function(options){var%20options=options||{};this.pointer=0;this.finish=options.finish||function(){};this.append=options.append||null;this.queue={length:0,list:[],push:function(arg){this.list.push(arg);this.length++;}};return%20this;};JSLoader.prototype={next:function(){var%20self=this;var%20loader=new%20JSLoader({append:self.append,finish:function(){self._next();}});var%20args=[];for(var%20i=0,l=arguments.length;i<l;i++){loader.assign(arguments[i]);}self.assign(function(){loader.run();});return%20this;},_next:function(){var%20func=this.queue.list[this.pointer++];if(func){func();}},assign:function(arg){var%20self=this;switch(typeof%20arg){case'string':this.queue.push(function(){self.load(arg,{append:self.append,onload:function(){self.report();}});});break;case'function':this.queue.push(function(){arg();self.report();});break;}},report:function(){this.queue.length--;if(this.queue.length==0){this.finish();}},start:function(){this._next();},run:function(){for(var%20i=0,l=this.queue.length;i<l;i++){this.queue.list[i]();}},load:function(src,options){var%20options=options||{};var%20element=options.append||document.body||document.documentElement;var%20script=document.createElement('script');script.src=src;script.type=options.type||'text/javascript';script.onload=options.onload||function(){};if(options.charset)script.charset=options.charset;if(document.all){script.onreadystatechange=function(){switch(script.readyState){case'complete':case'loaded':script.onload();break;}};}element.appendChild(script);}};function%20responder(data){var%20s='';var%20first_result;for(var%20r%20in%20data.results){first_result=data.results[r];break;}var%20x=prompt('Copy%20this!','%E3%80%8C'+document.title+'%E3%80%8D%20'+first_result["shortUrl"].toString());}new%20JSLoader().next('http://bit.ly/javascript-api.js?version=latest&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07').next(function(){BitlyClient.shorten(location.href,"responder");}).start();