寿司をふぁぼる
userstream監視して寿司という単語をふぁぼるプログラム書いた.golang初製品
programmerMOT/sushi_twitter · GitHub
仕組み
The simplest Twitter Streaming API by Golang - DRYな備忘録
ここの人が作ってるuserstreamだけ簡単に見れるgolangライブラリがあったのでこれでuserstream監視してる.
あとは寿司のいろんな表記に対してマッチしたら適当にふぁぼる.
func IsContainSushi(text string) (b bool) { if m, _ := regexp.MatchString("寿司|スシ|鮨|寿し|🍣|[sS][uU][sS][hH][iI]", text); !m { return false } return true }
ふぁぼるときはanacondaっていうのを使ってふぁぼるメソッドだけ利用した.
ChimeraCoder/anaconda · GitHub
様子
寿司
— MOT (@programmerMOT) 2015, 2月 5
寿司鮨すしスシ🍣
— tasuten (@tasuten) 2015, 2月 5
寿司に反応するのか。
— Tsushima (@utisam) 2015, 2月 6
あいつを倒すしかないな
— ほろあま (@horoama) 2015, 2月 5
おっぱい🍣
— しりかげる (@ty_0331) 2015, 2月 6