Created
June 9, 2017 02:06
-
-
Save ws/efdcdc002a95e5bf393463c5b9d0f782 to your computer and use it in GitHub Desktop.
Find a random Facebook event (to bring yourself out of your comfort zone)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by http://www.npr.org/sections/alltechconsidered/2017/06/08/531796329/eager-to-burst-his-own-bubble-a-techie-made-apps-to-randomize-his-life | |
// Literally all of the heavy lifting is done by https://github.com/tobilg/facebook-events-by-location-core | |
var EventSearch = require('facebook-events-by-location-core') | |
var es = new EventSearch({ | |
"lat": 42.338998, // http://www.latlong.net/ | |
"lng": -83.048520, | |
"distance": 250, | |
"accessToken": "YOURTOKENHERE" // https://developers.facebook.com/tools/accesstoken | |
}) | |
es.search().then((response) => { | |
var events = response.events | |
var event = events[Math.floor(Math.random()*events.length)] | |
console.log(event) | |
}).catch(function (error) { | |
console.error(JSON.stringify(error)); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment