How can I get the position (lat, lon) of a foursquare checkin posted on twitter?

前端 未结 2 2032
南笙
南笙 2021-02-10 04:30
  1. I search with the twitter API all the public tweets with \"4sq.com\":

    http://search.twitter.com/search.json?q=4sq.com

so I get all the check-

2条回答
  •  臣服心动
    2021-02-10 05:28

    There's actually a much nicer solution here if you would like to use the foursquare API. One that doesn't depend upon a user having enabled Twitter's geo-tagging.

    You noticed already that the link in the status update redirects to a foursquare page. Rather than screen scraping, you may notice there are two key pieces of information in the url. The checkin id, and a parameter called s (for signature) that lets you access that checkin via foursquare's API.

    https://foursquare.com/dens/checkin/4f0b3676e4b0e8ed3a590e41?s=MWHM3-0BsLXIJprfbALvOM606ZE&ref=tw

    For instance, in the above url, the checkin id is 4f0b3676e4b0e8ed3a590e41 while the signature is MWHM3-0BsLXIJprfbALvOM606ZE

    Using the /checkins endpoint, you can get the full checkin details (including lat/long of the venue). Dox here: https://developer.foursquare.com/docs/checkins/checkins

提交回复
热议问题