Skip to content

Instantly share code, notes, and snippets.

@nefo-mi
Created February 17, 2012 01:34
Show Gist options
  • Save nefo-mi/1849637 to your computer and use it in GitHub Desktop.
Save nefo-mi/1849637 to your computer and use it in GitHub Desktop.
ATNDから参加者のTwitterアカウントを抜き出すRubyスクリプト ref: http://qiita.com/items/2566
#!/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
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