Last active
March 28, 2018 10:40
-
-
Save gyosit/55330ccd2deb3698e42c80b9c6f4ad7d 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 "twitter" | |
client_streaming = Twitter::Streaming::Client.new do |config| | |
config.consumer_key = "<your consumer key>" | |
config.consumer_secret = "<your consumer secret>" | |
config.access_token = "<your access token>" | |
config.access_token_secret = "<your access token asecret>" | |
end | |
target = client.user("<@Screen Name>") #@で始まる方の名前 | |
client_streaming.user do |object| | |
case object | |
when Twitter::Tweet | |
if(object.user.name == target.name) then | |
text = object.text | |
puts text | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment