Skip to content

Instantly share code, notes, and snippets.

@ysr23
Created February 4, 2012 15:23
Show Gist options
  • Save ysr23/1738470 to your computer and use it in GitHub Desktop.
Save ysr23/1738470 to your computer and use it in GitHub Desktop.
using the twitter gem - private notes
ruby-1.9.2-p0 > Twitter.search("#mufc -rt", :rpp => 1).first
=> #<Twitter::Status:0x0000010120e728 @attrs={"created_at"=>"Sat, 04 Feb 2012 14:58:25 +0000", "from_user"=>"MostlyMinutiae", "from_user_id"=>19573143, "from_user_id_str"=>"19573143", "from_user_name"=>"Anthony Casaldi", "geo"=>nil, "id"=>165811451985014786, "id_str"=>"165811451985014786", "iso_language_code"=>"en", "metadata"=>{"result_type"=>"recent"}, "profile_image_url"=>"http://a2.twimg.com/profile_images/1490597356/image_normal.jpg", "profile_image_url_https"=>"https://si0.twimg.com/profile_images/1490597356/image_normal.jpg", "source"=>"&lt;a href=&quot;http://www.echofon.com/&quot; rel=&quot;nofollow&quot;&gt;Echofon&lt;/a&gt;", "text"=>"Looks like I'm waking up early to watch #MUFC vs #CFC tomorrow. And...rooting for Man U?! That feels dirty.", "to_user"=>nil, "to_user_id"=>nil, "to_user_id_str"=>nil, "to_user_name"=>nil}>
ruby-1.9.2-p0 > Twitter.search("#mufc -rt", :rpp => 1).first.from_user_id
=> 269318142
ruby-1.9.2-p0 > id = Twitter.search("#mufc -rt", :rpp => 1).first.from_user_id
=> 269318142
ruby-1.9.2-p0 > Twitter.user(id).location
=> "우리집"
ruby-1.9.2-p0 > id = Twitter.search("#mufc -rt", :rpp => 1).first.from_user_id
^[[A^[[A => 20262176
ruby-1.9.2-p0 > Twitter.user(id).location
=> "N 53° 9' 0'' / W 2° 12' 0''"
ruby-1.9.2-p0 > id = Twitter.search("#mufc -rt", :rpp => 1).first.from_user_id
=> 110653626
ruby-1.9.2-p0 > Twitter.user(id).location
=> "StretfordEndArising.com/forum"
ruby-1.9.2-p0 > id = Twitter.search("#mufc -rt", :rpp => 1).first.from_user_id
=> 234390225
ruby-1.9.2-p0 > Twitter.user(id).location
=> "Amanzimtoti, South Africa"
ruby-1.9.2-p0 > id = Twitter.search("#mufc -rt", :rpp => 1).first.from_user_id
=> 102753963
ruby-1.9.2-p0 > Twitter.user(id).location
=> "☑ Veryfried"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment