Created
June 7, 2015 04:08
-
-
Save khws4v1/d2172759672b5694ebad 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
# coding: utf-8 | |
require "twitter" | |
def is_spam(tweet) | |
source = tweet.source | |
source.include?("twittbot.net") || source.include?("IFTTT") | |
end | |
rest = Twitter::REST::Client.new do |config| | |
config.consumer_key = "" | |
config.consumer_secret = "" | |
config.access_token = "" | |
config.access_token_secret = "" | |
end | |
loop do | |
rest.search("相互フォローで繋がれる人募集中です!", count: 100, result_type: "recent").take(100).each do |object| | |
if is_spam(object) then | |
t = Thread.new do | |
rest.block(object.user.id) | |
end | |
puts "ID: #{object.user.id.to_s} NAME: #{object.user.name} SCREEN_NAME: #{object.user.screen_name}" | |
end | |
end | |
sleep 25 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment