Skip to content

Instantly share code, notes, and snippets.

@ckolderup
Last active August 29, 2015 14:20
Show Gist options
  • Save ckolderup/5a0f6b12cd916f4be337 to your computer and use it in GitHub Desktop.
Save ckolderup/5a0f6b12cd916f4be337 to your computer and use it in GitHub Desktop.
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
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