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
#include<string> | |
#include<iostream> | |
#include<stack> | |
int main() | |
{ | |
std::string s; | |
while(std::getline(std::cin, s)) | |
{ | |
for each(char c in s) |
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
function quotedReply(id) | |
{ | |
var status = TwitterService.status.get(id); | |
var text = "QT @" + status.user.screen_name + ": " + status.text; | |
TextArea.text = text; | |
TextArea.in_reply_to_status_id = status.id; | |
TextArea.show(); | |
TextArea.setFocus(); | |
TextArea.setCursor(0); | |
} |
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
/* | |
コンテキストメニューに選択されたTweetの送信者の | |
Favstarを開くコマンドを追加する拡張 | |
同じ機能をShift+Fにも割り当てる。 | |
*/ | |
function openFavstar(id) | |
{ | |
var status = TwitterService.status.get(id); | |
System.openUrl('http://favstar.fm/users/' + status.user.screen_name + '/recent'); | |
} |
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
/* | |
Twitのようなショートカットキーを拡張スクリプトで実装してみる。 | |
H,Oには組み込みのショートカットが実装されてるけども、 | |
スクリプト側で上書きしたのが優先される。 | |
*/ | |
// Hキーでユーザをブラウザで表示する | |
System.addKeyBindingHandler('H'.charCodeAt(0), 0, function(id){ | |
var s = TwitterService.status.get(id); | |
System.openUrl('http://twitter.com/' + s.user.screen_name); | |
}); |
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
/* | |
Beta4で追加されたHTTP Post APIを使って診断メーカーをアプリないで解決してみるスクリプト。 | |
*/ | |
System.addContextMenuHandler('診断メーカー', 0, function(id){ | |
var status = TwitterService.status.get(id); | |
var curUsr = TwitterService.currentUser(); | |
if(status.text.match('http://shindanmaker.com/[0-9]+')){ | |
var resp = Http.postRequest(RegExp.lastMatch, "u="+encodeURI(curUsr.screen_name), false); | |
resp.body.match('<textarea.*?>(.*?)</textarea>'); | |
TextArea.text = RegExp.$1; |
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
/* | |
選択されたユーザのホームからPost数を探してきて表示してみる | |
*/ | |
System.addContextMenuHandler('Get tweets count', 0, function(id){ | |
var st = TwitterService.status.get(id); | |
var html = Http.downloadString("http://twitter.com/" + st.user.screen_name); | |
if(html.match('<span id="update_count" class="stat_count">([0-9,]+)</span>')){ | |
System.showNotice("@" + st.user.screen_name + "'s total tweets: " + RegExp.$1); | |
} | |
}); |
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
/* | |
選択されたユーザのホームからPost数を探してきて表示してみる API版(Require API Level:5-) | |
*/ | |
System.addContextMenuHandler('Get tweets count', 0, function(id){ | |
var st = TwitterService.status.get(id); | |
var xml = TwitterService.call('/users/show/' + st.user.screen_name + '.xml'); | |
if(xml.match('<statuses_count>(\\d+)</statuses_count>')){ | |
System.showNotice("@" + st.user.screen_name + "'s total tweets: " + RegExp.$1); | |
} | |
}); |
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
/* | |
Postの中で最初に出現するURLをブラウザで開くショートカットキーをつくってみた。 | |
.キーで実行されまする。 | |
API Level >= 8 な環境で使ってね! | |
*/ | |
System.addKeyBindingHandler(0xBE, 0, function(id){ | |
var urls = new Array(); | |
TwitterService.status.getUrls(id, urls); | |
if(urls.length > 0) System.openUrl(urls[0]); | |
}); |
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
System.addContextMenuHandler('mention',0,function(id){if(id!='0'){var s=TwitterService.status.get(id);TextArea.text='@'+s.user.screen_name;TextArea.show();TextArea.setFocus();}); |
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
/* | |
診断メーカーする拡張(https://gist.github.com/756337)の非同期版。 | |
Require: API Level >= 9 | |
*/ | |
System.addContextMenuHandler('診断メーカー', 0, function(id){ | |
var status = TwitterService.status.get(id); | |
var curUsr = TwitterService.currentUser(); | |
if(status.text.match('http://shindanmaker.com/[0-9]+')){ | |
Http.postRequestAsync(RegExp.lastMatch, "u="+encodeURI(curUsr.screen_name), false, function(resp){ | |
resp.body.match('<textarea.*?>(.*?)</textarea>'); |
OlderNewer