Created
February 17, 2012 01:34
-
-
Save nefo-mi/1849637 to your computer and use it in GitHub Desktop.
ATNDから参加者のTwitterアカウントを抜き出すRubyスクリプト ref: http://qiita.com/items/2566
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'json' | |
if ARGV.first.nil? | |
puts <<EOF | |
USAGE: export_atnd2twit.rb [ATND EVENT ID] | |
e.g. ruby export_atnd2twit.rb 24700 | |
# http://atnd.org/events/24700 | |
NOTE: List Limit members 500! | |
EOF | |
exit 1 | |
end | |
atnd_id = ARGV.first | |
url = "http://api.atnd.org/events/users/?format=json&event_id=#{atnd_id}" | |
json = open(url).read | |
result = JSON.parse(json) | |
members = result['events'].first['users'] | |
puts members.map{|member| member["twitter_id"] if member["status"] == 1}.compact |
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
ruby export_atnd2twit.rb 24700|xargs ruby import_twilist.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment