Last active
May 1, 2017 12:06
-
-
Save turanegaku/58a8ddf22d00b5a805f6cc9f64fc00fb to your computer and use it in GitHub Desktop.
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
require 'tweetstream' | |
TweetStream.configure do |config| | |
config.consumer_key = '' | |
config.consumer_secret = '' | |
config.oauth_token = '' | |
config.oauth_token_secret = '' | |
config.auth_method = :oauth | |
end | |
client = TweetStream::Client.new | |
db = {} | |
client.track('参加者募集', 'Lv75', 'セレスト・マグナ') do |status| | |
begin | |
m = /.*参戦ID:(.*).*/.match(status.text) | |
if m | |
puts m[1] | |
if not db[m[1]] | |
db[m[1]] = true | |
`echo #{m[1]} | pbcopy` | |
end | |
end | |
rescue => e | |
p e | |
end | |
end | |
puts 'start' | |
begin | |
client.userstream | |
rescue => e | |
p e | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment