2016-08-03から1日間の記事一覧
twitter api つぶやき数を指定して取得 title = @twitter.search("検索ワード") title.take(500).each do |tw| #以下略 参考:Twitter gemでツイート検索する場合の要点、及び:since_id指定を有効にするモンキーパッチ - Qiita
branchの名前を変える git branch -m <古いブランチ名> <新しいブランチ名>
RTを含むAPIでの検索 @twitter_client = Twitter::REST::Client.new do |config| config.consumer_key = "xxxx" config.consumer_secret = "xxxx" config.access_token = "xxxx" config.access_token_secret = "xxxx" end @twitter_client.search("検索ワード…
flatten 多次元配列をシンプルな配列にする array = [1, 2, 3, [4, 5]] p array.flatten #=>[1,2,3,4,5] 参考:flatten, flatten! (Array) - Rubyリファレンス
combination 配列から引数n個の要素を選んだときの組合せを出力 array = ["a","b","c","d","e"] p array.combination(2).to_aa~eまでの、5C2の全てのパターンを出力