Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- require 'yaml'
- require 'logger'
- require 'net/http'
- require 'twitter'
- LOG = Logger.new('log')
- LISTS = [22926920, 22919856, 22917276, 22914957, 22912272, 22898839]
- USER= 'niku_name'
- ACCOUNT = YAML.load_file('account.yaml')
- Twitter.configure do |config|
- config.consumer_key = ACCOUNT['consumer']['key']
- config.consumer_secret = ACCOUNT['consumer']['secret']
- config.oauth_token = ACCOUNT['access']['key']
- config.oauth_token_secret = ACCOUNT['access']['secret']
- end
- @client = Twitter::Client.new
- begin
- LISTS.each do |list_id|
- LOG.info "#{list_id} 削除中..."
- @client.list_delete(USER, list_id)
- LOG.info "#{list_id} 削除完了"
- end
- rescue
- LOG.warn $!
- ensure
- LOG.info "残り #{@client.lists(USER).lists.map{ |l| l.name }}"
- end
Add Comment
Please, Sign In to add comment