As per our previous discussion, I would make this script as close as possible to the script I made with the Facebook project, but using Foursquare's v2 API to find places instead.
At most, this will take 7 days, in order to get around Foursquare's API rate limiting. If this is an issue, please let me know.