Last active
August 29, 2015 14:20
-
-
Save ckolderup/5a0f6b12cd916f4be337 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
pwd = Dir.new('.') | |
pwd.entries.select do |e| | |
next unless /^.+\.csv$/.match(e) | |
IO.readlines(e).each do |line| | |
arr = line.split(',') | |
id = arr[0] | |
source = arr[6] | |
puts id.gsub('"', '') if /#{ARGV[0]}/.match(source) | |
end | |
end |
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' | |
require 'dotenv' | |
Dotenv.load | |
def twitter_client | |
Twitter::REST::Client.new do |config| | |
config.consumer_key = ENV['TWITTER_CONSUMER_KEY'] | |
config.consumer_secret = ENV['TWITTER_CONSUMER_SECRET'] | |
config.access_token = ENV['TWITTER_ACCESS_TOKEN'] | |
config.access_token_secret = ENV['TWITTER_ACCESS_TOKEN_SECRET'] | |
end | |
end | |
tweet_ids = File.readlines(ARGV[0]) | |
tweet_ids.each do |id| | |
puts "deleting #{id}" | |
twitter_client.destroy_status(id) | |
sleep(30) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment