0

What my overall aim is to have check-ins from a group of friends be displayed (most recent first) on a private web-app I am building.

Is this possible? And if so, could someone kindly lead me in the right direction.

Thank you in advance :)

  • Are you asking if there is a way to grab only group checkins? – Jonathan Jan 10 '13 at 23:44
  • No sorry. I was wondering whether the realtime API allows watching for checkins over a group of people. So I can have the most recent checkins out of my group of friends put at the top of the page. Does this make sense? – Scott McConnell Jan 10 '13 at 23:49
  • Are these random people, or will they allow oAuth? – Jonathan Jan 10 '13 at 23:52

1 Answers1

1

As long as they oAuth your application, you should be able to do this. You can't do this unless they explicitly allow you to for obvious security reasons. If you want a way around that, you can web scrape, but that is another issue entirely.

Take a look at their Real-Time API: https://developer.foursquare.com/overview/realtime

Create an application, then utilize their User Push API - every time one of them checks in, it should push something like this to your server:

      {
          "id": "4e6fe1404b90c00032eeac34",
          "createdAt": 1315955008,
          "type": "checkin",
          "timeZone": "America/New_York",
          "user": {
              "id": "1",
              "firstName": "Jimmy",
              "lastName": "Foursquare",
              "photo": "https://foursquare.com/img/blank_boy.png",
              "gender": "male",
              "homeCity": "New York, NY",
              "relationship": "self"
          },
          "venue": {
              "id": "4ab7e57cf964a5205f7b20e3",
              "name": "foursquare HQ",
              "contact": {
                  "twitter": "foursquare"
              },
              "location": {
                  "address": "East Village",
                  "lat": 40.72809214560253,
                  "lng": -73.99112284183502,
                  "city": "New York",
                  "state": "NY",
                  "postalCode": "10003",
                  "country": "USA"
              },
              "categories": [
                  {
                      "id": "4bf58dd8d48988d125941735",
                      "name": "Tech Startup",
                      "pluralName": "Tech Startups",
                      "shortName": "Tech Startup",
                      "icon": "https://foursquare.com/img/categories/building/default.png",
                      "parents": [
                          "Professional & Other Places",
                          "Offices"
                      ],
                      "primary": true
                  }
              ],
              "verified": true,
              "stats": {
                  "checkinsCount": 7313,
                  "usersCount": 565,
                  "tipCount": 128
              },
              "url": "http://foursquare.com"
          }
      }

Best of luck to you!

Jonathan
  • 996
  • 1
  • 7
  • 27