/*
* @title 最古ツイート検索
* @description ウェブ版Twitter上でもっとも古いツイートを探す
* @include https://twitter.com/*
* @license MIT License
* @javascript_url
*/
(function(w, d, search_words){
if (!search_words) return;
var cwin = w.open('about:blank'), cdoc = cwin.document;
var html = '
twSearchFirstTweet: #T#twSearchFirstTweet
#B#';
cdoc.open();
cdoc.write(html.replace(/#T#/g, 'Now searching ...').replace(/#B#/g, ''));
cdoc.close();
$.getScript('//furyu-tei.sakura.ne.jp/script/twSearchFirstTweet.js?t='+new Date().getTime(),function(){
search_first_tweet(search_words, function(info, tweets){
//cwin.location.href = info.search_url;
if (0 < tweets.length) {
var tweet = tweets[tweets.length-1];
var tweet_html = '';
}
else {
var tweet_html = 'Not found.
';
}
cdoc.open();
cdoc.write(html.replace(/#T#/g, 'Result').replace(/#B#/g, ''+tweet_html));
cdoc.close();
});
});
})(window, document, prompt('search words',String(document.getSelection())));