Skip to main content

Sync Foursquare Swarm check-ins to local sqlite DB and generate iCalendar

Project description

foursquare-swarm-ical

Sync Foursquare Swarm check-ins to local sqlite DB (incrementally) and generate iCalendar.

PyPI Python Version badge PyPI Version badge License badge

Installation

Using pipx:

pipx ensurepath
pipx install git+https://github.com/liskin/foursquare-swarm-ical

To keep a local git clone around:

git clone https://github.com/liskin/foursquare-swarm-ical
make -C foursquare-swarm-ical pipx

Alternatively, if you don't need the isolated virtualenv that pipx provides, feel free to just:

pip install git+https://github.com/liskin/foursquare-swarm-ical

Preparation

You'll need to obtain a Foursquare API Access Token. The easiest way to obtain one is to use their API Exporer. Grant it permission for your account, open DevTools, let it execute an API call and then inspect the request and copy oauth_token from the Query String Parameters.

Usage

$ foursquare-swarm-ical --help
Usage: foursquare-swarm-ical [OPTIONS]

  Sync Foursquare Swarm check-ins to local sqlite DB and generate iCalendar

Options:
  -v, --verbose             Be more verbose
  --sync / --no-sync        Sync again or just use local database?  [default:
                            sync]
  --access-token TEXT       Foursquare oauth2 access token  [env var:
                            FOURSQUARE_TOKEN]
  --database PATH           SQLite database file  [default: /home/user/.local/
                            share/foursquare_swarm_ical/checkins.sqlite]
  -e, --emoji / --no-emoji  Prefix summary with venue category as emoji
                            [default: no-emoji]
  -o, --output FILENAME     Output file
  --config FILE             Read configuration from FILE.  [default: /home/use
                            r/.config/foursquare_swarm_ical/config.yaml]
  --config-sample           Show sample configuration file
  --help                    Show this message and exit.

Example:

$ foursquare-swarm-ical --access-token TOKENTOKENTOKEN
BEGIN:VCALENDAR
VERSION:2.0
PRODID:foursquare-swarm-ical
BEGIN:VEVENT
SUMMARY:@ Venue
DTSTART;VALUE=DATE-TIME:20120304T214456Z
…

Configuration file

Access token (and other options) can be set permanently in a config file, which is located at ~/.config/foursquare_swarm_ical/config.yaml by default (on Linux; on other platforms see output of --help).

Sample config file can be generated using the --config-sample flag:

$ foursquare-swarm-ical --config-sample
# Be more verbose
verbose: 0

# Sync again or just use local database?
sync: true

# Foursquare oauth2 access token
access_token: TEXT

# SQLite database file
database: /home/user/.local/share/foursquare_swarm_ical/checkins.sqlite

# Prefix summary with venue category as emoji
emoji: false

# Output file
output: '-'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foursquare-swarm-ical-1.0.0b8.tar.gz (29.8 kB view hashes)

Uploaded Source

Built Distribution

foursquare_swarm_ical-1.0.0b8-py3-none-any.whl (23.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page