Skip to content

Instantly share code, notes, and snippets.

@turanegaku
Last active May 1, 2017 12:06
Show Gist options
  • Save turanegaku/58a8ddf22d00b5a805f6cc9f64fc00fb to your computer and use it in GitHub Desktop.
Save turanegaku/58a8ddf22d00b5a805f6cc9f64fc00fb to your computer and use it in GitHub Desktop.
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