Skip to content

Instantly share code, notes, and snippets.

@khws4v1
Created June 7, 2015 04:22
Show Gist options
  • Save khws4v1/eae84c4873339105183a to your computer and use it in GitHub Desktop.
Save khws4v1/eae84c4873339105183a to your computer and use it in GitHub Desktop.
ヤフオクスパム死ね死ねスクリプト
# coding: utf-8
require "twitter"
def is_spam(tweet)
text = tweet.text
if /.*現在の価格.*現在の入札人数.*詳しくはコチラ!.*/m =~ text
true
elsif /.*現在価格:.*,入札数:.*,終了日時:.*/ =~ text
true
elsif /.*詳細はコチラ→.*#ヤフオク.*/m =~ text
true
else
false
end
end
stream = Twitter::Streaming::Client.new do |config|
config.consumer_key = ""
config.consumer_secret = ""
config.access_token = ""
config.access_token_secret = ""
end
rest = Twitter::REST::Client.new do |config|
config.consumer_key = ""
config.consumer_secret = ""
config.access_token = ""
config.access_token_secret = ""
end
stream.filter(track: "ヤフオク, applunch x0 to") do |object|
if object.is_a?(Twitter::Tweet) then
if is_spam(object) then
p object.user.id.to_s
t = Thread.new do
rest.block(object.user)
end
end
end
end
@D25SK
Copy link

D25SK commented Oct 9, 2015

使い方教えて下さい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment