Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JasonBates/mhook
https://github.com/JasonBates/mhook
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/JasonBates/mhook
- Owner: JasonBates
- Created: 2015-12-18T20:18:28.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-19T15:14:00.000Z (almost 9 years ago)
- Last Synced: 2024-08-03T18:19:32.572Z (4 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-monzo - Foursquare - Auto-foursquare checkin on transansactions (Integrations)
README
## Mondo Foursquare Webhook 1.0
Basic foursquare checkin python script
powered by flask it provides a web hook end point
for receiving a transaction webhook, checking for a foursquare location
and checking in through the foursquare API.The code is self explanatory, but basically the steps are:
1. Receive a notification of a transaction
2. Do a foursquare lookup based on the merchant name and latitude / longitude
3. Use fuzzy matching (fuzzywuzzy) to compare the response with the merchant name
4. If it's a reasonably good match do a checkin through the foursqaure API.This script needs a Mondo ClientID / Secret and a Foursquare Oauth key
saved in the config file : 4sq.json-template which should be renamed to 4sq.jsonYou can generate the Oauth key with Postman once you've set up a Foursquare app / developer account.
Python libraries required : requests, flask, fuzzywuzzy.
(I use nginx / Gunicorn to run it through WSGI in the wild)