-
-
Save n1ckfg/22e8d9b35a376476f727 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
# encoding: utf-8 | |
require "rubygems" | |
require "twitter" | |
rClient = Twitter::REST::Client.new do |config| | |
config.consumer_key = "" | |
config.consumer_secret = "" | |
config.access_token = "" | |
config.access_token_secret = "" | |
end | |
sClient = Twitter::Streaming::Client.new do |config| | |
config.consumer_key = "" | |
config.consumer_secret = "" | |
config.access_token = "" | |
config.access_token_secret = "" | |
end | |
me = "" # prevent DMing yourself | |
sClient.user do |object| | |
if object.is_a? Twitter::Streaming::Event and object.name==:follow | |
user = object.source | |
if user.name != me | |
rClient.create_direct_message user, "Thanks for following me #{user.name} :)" | |
puts "New follower : #{object.source.name}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment