Extract your Foursquare/Swarm history using the command line with this plugin for chronicle-etl.
# Install chronicle-etl and this plugin
$ gem install chronicle-etl
$ chronicle-etl plugins:install foursquare
To get access to the Foursquare API, you must first create an app. Press the "Create New Project" button in the Developer Home.
In the app's setting, in the Redirect URIs
field, add http://localhost:4567/auth/foursquare/callback
. After your app has been saved, grab the client_id
and client_secret
credentials and save them to chronicle-etl secrets:
$ chronicle-etl secrets:set foursquare client_id
$ chronicle-etl secrets:set foursquare client_secret
Next, we need an access token for accessing your data. We can use the authorization flow:
$ chronicle-etl authorizations:foursquare
This will open a browser window to authorize on foursquare.com. When the flow is complete, access/refresh tokens will be saved in the chronicle secret system under the "foursquare" namespace. It'll be available automatically whenever you use this plugin.
# Extract recent checkins
$ chronicle-etl --extractor foursquare --since 1w
# Transform as Chronicle Schema
$ chronicle-etl --extractor foursquare --since 1w --schema chronicle
# Get a table of dates and place name
$ chronicle-etl --extractor foursquare --since 1w --schema chronicle --fields end_time object.name --loader table
Extractor for your Foursquare (via the Swarm app) checkins
access_token
: (required) API access token for foursquare. By default, it's loaded from secrets under thefoursquare
namespace. You can check if it's available withchronicle-etl secrets:list foursquare