Re: coordinates

30 views
Skip to first unread message

rakesh mukundan

unread,
May 21, 2013, 6:58:07 AM5/21/13
to python-...@googlegroups.com
If you want to access coordinates from a status, try the following

status = <some function which will return you a status object>
 if status.get('coordinates') : # coordinates are not always present in a tweet
                longi        = status['coordinates']['coordinates'][0]
                lat        = status['coordinates']['coordinates'][1]

-----
Rakesh Mukundan
http://www.rakeshmukundan.in/


On Mon, May 20, 2013 at 11:21 PM, <axel.c...@gmail.com> wrote:
hi, well i guess exist a method to acces coordinates 'cause i saw:

status.geo
status.place
status.coordinates

and read at https://dev.twitter.com/discussions/3755

Some search API responses will contain a populated "geo" object:

  1.       "geo": {
  2.         "coordinates": [
  3.           40.6455,
  4.           -73.7757
  5.         ],
  6.         "type": "Point"
  7.       },

Others will contain a "location", pulled from the user's profile location info. Sometimes this has coordinates:

"location": "iPhone: 40.643913,-73.749466",

but other times it may be arbitrary:

"location": "YYZ - JFK",



but i want to know how to acces and use it... i try: coor = twitter.status(); print [c for c in coor]  but nothing ... only get a memmory address anyone can explain me how to? examples or anything?

--
You received this message because you are subscribed to the Google Groups "python-twitter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-twitte...@googlegroups.com.
To post to this group, send email to python-...@googlegroups.com.
Visit this group at http://groups.google.com/group/python-twitter?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages