Skip to content

Azure Function for creating iCalendar from your Foursquare Swarm check-ins

License

Notifications You must be signed in to change notification settings

sVathis/foursquare-calendar

Repository files navigation

Foursquare Swarm check-ins as iCalendar (Azure Function)

This Azure Function creates an iCalendar with all your Foursquare Swarm check-ins as events. You can subscribe to this iCalendar from your favorite calendaring program and have calendar entries created on every check-in

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See Cloud deployment for notes on how to deploy the project on Azure.

Prerequisites

In order for this service to work you will need:

  1. A valid Azure subscription
  2. An [Foursquare developer account](TODO: url)

You will also need the following software installed in your dev enviroment:

  1. Azure CLI
  2. Azure Function Core Tools
  3. Node.js (required for Azure Functions Core Tools)

Installing

Foursquare API access

To use Foursquare APIs, you need to register with the Foursquare Developer and create an application, using this form.

Generate a unique set of keys (a keyset) that will serve as your application’s credentials:

  • Client ID: This uniquely identifies your application.
  • Client Secret: This is a client secret (like a password for your Client ID), which should be kept confidential.
  • Access Token: A unique access token

You should copy and save your keys locally in the credentials.sh file, for use in this application, as follows:

FOURSQUARECLIENTID=<Client ID>
FOURSQUARECLIENTSECRET=<Client Secret>
FOURSQUAREACCESSTOKEN=<Access Token>

These credentials will be privatly uploaded to Azure as App settings by the bootstrap.sh script.

node.js enviroment

Install locally all required modules as follows:

$ npm install

Deploying

First you will need to set the values of the following variables in definitions.sh file:

rgName=<Resource Group Name>
storageName=<Storage Account Name>
functionAppName=<FunctionApp Name>
location=<Location>

Note: rgName and storageName should be unique across your Azure subscription. functionAppName should be unique across Azure(!). location should be an Azure Location preferably be as close as possible to your physical location.

Local deployment