(Ruby)(Gems)(Twitter)
自分用メモです
RubyGems の Twitter(0.9.4)で followers を取得した時のデータの データ構造
一人ずつのデータから 各データを取得する場合は
RubyGems の Twitter(0.9.4)で followers を取得した時のデータの データ構造
<#Hashie::Mash contributors_enabled= created_at= description= favourites_count= followers_count= following= friends_count= geo_enabled= id= lang= location= name= notifications= profile_background_color= profile_background_image_url= profile_background_tile= profile_image_url= profile_link_color= profile_sidebar_border_color= profile_sidebar_fill_color= profile_text_color= protected= screen_name= status=<#Hashie::Mash created_at= favorited= id= in_reply_to_screen_name= in_reply_to_status_id= in_reply_to_user_id= source= text= truncated= > statuses_count= time_zone= url= utc_offset= verified= >が一人分のデータで、 複数人いると これの配列となる。
httpauth = Twitter::HTTPAuth.new('TwitterID' , 'LoginPassword') client = Twitter::Base.new(httpauth)として クライアントを生成した場合
client.followersとすると 上に示したデータが 返って来る
client.followers.each { |usr| # 処理 }とすることで 一人ずつデータを処理できる
一人ずつのデータから 各データを取得する場合は
usr.screen_name usr.status.textなどとする