Skip to content

Commit

Permalink
Started adding geo retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
brentsowers1 committed Sep 22, 2010
1 parent ddef738 commit 990a2fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/twitterscour.rb
@@ -1,6 +1,5 @@
require 'rubygems'
require 'nokogiri'
#require 'open-uri'
require 'httparty'
require File.dirname(__FILE__) + "/tweet"
require 'json'
Expand All @@ -23,6 +22,12 @@ def self.from_user(username, number_of_pages=1, fetch_location_info=false)
meta_data = JSON.parse(meta_data_str)
t.author_pic = meta_data["avatar_url"]
place_id = meta_data["place_id"]
token = main_page.css("input#authenticity_token").first[:value]
if place_id
geo_data_str = HTTParty.get("http://twitter.com/1/geo/id/#{place_id}.json?authenticity_token=#{token}&twttr=true")
geo_data = geo_data_str.to_json
t.location = geo_data
end
end
t
end
Expand Down

0 comments on commit 990a2fd

Please sign in to comment.