Can a checkin automatically trigger a web service?

39 views
Skip to first unread message

wubbahed

unread,
Feb 8, 2010, 2:56:32 PM2/8/10
to foursquare API
Is it possible to have a web service called whenever a user performs a
checkin?

I'm working on a web site where registered users can sign up to
receive a custom, contextual SMS message on their mobile whenever they
checkin to Foursquare. I'm not building a custom Foursquare client,
I'm just building a free, non-commercial add-on service that
complements existing Foursquare clients. So it's crucial that my
service work with all the existing Foursquare clients.

Ideally, after a user does the oauth dance on my site, I'd like to be
able to add a rule to 4sq saying, "Call this URL whenever this user
performs a checkin".

If this isn't possible, then the only other way I see of doing this is
after the oauth dance, to constantly ping a user's checkin RSS feed
for changes, and alert them when I notice a new checkin. But that
option seems like an unnecessary waste of both mine and Foursquare's
CPU cycles...

Thoughts? Alternative ideas?

naveen

unread,
Feb 10, 2010, 10:30:04 AM2/10/10
to foursquare API
will

it is a great idea

one that's been on my list for a long time + that we're still thinking
about

curious to hear your thoughts on these 'triggers' versus XMPP or a
similar stream

naveen

molson

unread,
Mar 29, 2010, 5:19:58 PM3/29/10
to foursquare API
Has anything been developed yet where Foursquare calls an external API
(via http post) whenever a user checks in? Or, is the only option to
get (near) real time check-ins to constantly ping a user's checkin RSS
feed for changes (as described by wubbahed above)?

Thanks,

- mOlson


On Feb 10, 8:30 am, naveen <naveen...@gmail.com> wrote:
> will
>
> it is a great idea
>
> one that's been on my list for a long time + that we're still thinking
> about
>
> curious to hear your thoughts on these 'triggers' versus XMPP or a
> similar stream
>
> naveen
>
> On Feb 8, 2:56 pm, wubbahed <will.turn...@gmail.com> wrote:
>
>
>
> > Is it possible to have a web service called whenever a user performs a
> >checkin?
>
> > I'm working on a web site where registered users can sign up to
> > receive a custom, contextual SMS message on their mobile whenever they

> >checkinto Foursquare.  I'm not building a custom Foursquare client,


> > I'm just building a free, non-commercial add-on service that
> > complements existing Foursquare clients.  So it's crucial that my
> > service work with all the existing Foursquare clients.
>
> > Ideally, after a user does the oauth dance on my site, I'd like to be
> > able to add a rule to 4sq saying, "Call this URL whenever this user

> > performs acheckin".


>
> > If this isn't possible, then the only other way I see of doing this is

> > after the oauth dance, to constantly ping a user'scheckinRSS feed
> > for changes, and alert them when I notice a newcheckin.  But that


> > option seems like an unnecessary waste of both mine and Foursquare's
> > CPU cycles...
>

> > Thoughts? Alternative ideas?- Hide quoted text -
>
> - Show quoted text -

Jeremy Kelley

unread,
Mar 29, 2010, 5:42:46 PM3/29/10
to foursqu...@googlegroups.com
There may be a better way... but for Kingpin, the way we handle this is the client goes to the foursquare API for as much as it can, but checkins roll through our webservice which then connects to the foursquare API to complete the checkin.

This way, we can act on checkin and do things we need to do (like record a kill, increment currency, etc).

-jeremy

ps - hi list!  I wrote Kingpin (kingpingame.com) so have been abusing the foursquare api lately, but just lurking silently on the list.



--
To post to this group, send email to foursqu...@googlegroups.com

http://groups.google.com/group/foursquare-api

To unsubscribe from this group, send email to foursquare-api+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.



--
Jeremy Kelley <jer...@phodder.com> cell: 979.820.8202
CEO, Co-Founder of Phodder
Makers of Mobile Applications and Solvers of Interesting Problems

Mark Atwood

unread,
Mar 29, 2010, 6:51:45 PM3/29/10
to foursqu...@googlegroups.com
It would be very useful if 4sq implemented PubSubHubBub for this very sort of thing.

David Wang

unread,
May 4, 2010, 11:01:58 AM5/4/10
to foursquare API
Naveen,

did you guys ever build a solution to this? im taking a obj-c
programming class and am trying to get real-time checkin info without
constantly hitting your site or having the user use my app to checkin
(ruining the 4sq experience).

-d

Noel

unread,
Jun 15, 2010, 5:20:11 PM6/15/10
to foursquare API
Hi,

Just want to jump in and say this is something I would love to see as
well. It would definitely reduce the amount of polling currently
necessary for this kind of data.
-User OAuths on 3rd Party site
-3rd party site registers a webservice as a listener for an event (say
"checkin")
-When user checks in, foursquare fires event to webservice

Noel


On May 4, 11:01 am, David Wang <dw...@udfi.biz> wrote:
> Naveen,
>
> did you guys ever build a solution to this?  im taking a obj-c
> programming class and am trying to get real-time checkin info without
> constantly hitting your site or having the user use my app to checkin
> (ruining the 4sq experience).
>
> -d
>
> On Mar 29, 6:51 pm, Mark Atwood <fallenpega...@gmail.com> wrote:
>
>
>
>
>
> > It would be very useful if 4sq implemented PubSubHubBub for this very sort
> > of thing.
>
> > On Mon, Mar 29, 2010 at 2:42 PM, Jeremy Kelley <jer...@phodder.com> wrote:
> > > There may be a better way... but for Kingpin, the way we handle this is the
> > > client goes to the foursquare API for as much as it can, but checkins roll
> > > through our webservice which then connects to the foursquare API to complete
> > > the checkin.
>
> > > This way, we can act on checkin and do things we need to do (like record a
> > > kill, increment currency, etc).
>
> > > -jeremy
>
> > > ps - hi list!  I wrote Kingpin (kingpingame.com) so have been abusing the
> > > foursquare api lately, but just lurking silently on the list.
>
> > > On Mon, Mar 29, 2010 at 4:19 PM, molson <mol...@ex3solutions.com> wrote:
>
> > >> Has anything been developed yet where Foursquare calls an external API
> > >> (via http post) whenever a user checks in?  Or, is the only option to
> > >> get (near) real time check-ins to constantlypinga user's checkin RSS
> > >> feed for changes (as described by wubbahed above)?
>
> > >> Thanks,
>
> > >> - mOlson
>
> > >> On Feb 10, 8:30 am, naveen <naveen...@gmail.com> wrote:
> > >> > will
>
> > >> > it is a great idea
>
> > >> > one that's been on my list for a long time + that we're still thinking
> > >> > about
>
> > >> > curious to hear your thoughts on these 'triggers' versus XMPP or a
> > >> > similar stream
>
> > >> > naveen
>
> > >> > On Feb 8, 2:56 pm, wubbahed <will.turn...@gmail.com> wrote:
>
> > >> > > Is it possible to have a web service called whenever a user performs a
> > >> > >checkin?
>
> > >> > > I'm working on a web site where registered users can sign up to
> > >> > > receive a custom, contextual SMS message on their mobile whenever they
> > >> > >checkinto Foursquare.  I'm not building a custom Foursquare client,
> > >> > > I'm just building a free, non-commercial add-on service that
> > >> > > complements existing Foursquare clients.  So it's crucial that my
> > >> > > service work with all the existing Foursquare clients.
>
> > >> > > Ideally, after a user does the oauth dance on my site, I'd like to be
> > >> > > able to add a rule to 4sq saying, "Call this URL whenever this user
> > >> > > performs acheckin".
>
> > >> > > If this isn't possible, then the only other way I see of doing this is
> > >> > > after the oauth dance, to constantlypinga user'scheckinRSS feed

Colin Hill

unread,
Jun 15, 2010, 6:00:07 PM6/15/10
to foursqu...@googlegroups.com
Noel,
This has been discussed several times in the past and I think the
general consensus is PubSubHubbub is the way to go in terms of real-time
check-in notification, whereby a consumer/user would be able to
subscribe to a feed of check-ins serviced using a PubSubHubbub hub to
receive real-time pings with the full update information encoded in XML.
With only a slight divergence from the standard, one could envision such
notifications encoded as JSON as well.
Practically speaking, implementing a PubSubHubbub hub us quite
simple. Scaling it in a sane way becomes a challenge as it would be
required to fire off one POST request per subscription so for popular
venues the real-time quality of the notifications might suffer as they
would have to be queued and fired off on a FIFO basis. As long as you
throw a reasonable number of threads at it you could keep it in check
but eventually notification speed would suffer for some venues. It's not
really clear how best to handle this, and even at it's best this would
provide notification only for server based foursquare client apps.

-- Colin

David Wang

unread,
Jun 15, 2010, 6:53:24 PM6/15/10
to foursqu...@googlegroups.com
Colin,

Are you looking for a data feed for checkins across the board or are you looking for checkins for your users?

If you're looking for checkins just for your users, what i've done is create a bot account that automatically friends your user. The bot then constantly pings the system 2x/min requesting friends' checkins. This is the only way i've seen to simulate a real time feed for user checkins. Obviously, if your user decides to unfriend your bot, then you would lose the real time checkin data.

It'd be cool if some sort of real time check stream (XMPP/PubSubHub/whatevs) was established. If that were possible, some real cool recommendation apps/etc could be built off the data set.

-d

Colin Hill

unread,
Jun 15, 2010, 7:21:34 PM6/15/10
to foursqu...@googlegroups.com
David,
Our goal is to be able to subscribe to a venue and get all checkins
for that venue, rather than for a specific subset of users. The
methodology we've been using is to periodically poll the venues in which
we're interested to collect the most recent check-ins, but this approach
has serious drawbacks in efficiency, performance and timeliness, so a
push system would be far better for our use case, but our current
implementation looks like it will be sufficient for the moment.

-- Colin

Anthony Broad-Crawford

unread,
Jun 16, 2010, 9:46:16 AM6/16/10
to foursqu...@googlegroups.com
+1 for Pubsubhubbub with ActivityStrea.ms 

Anthony Broad-Crawford
Vice President and Chief Technology Officer @ Within3

www.anthonybroadcrawford.com
www.twitter.com/broadcrawford

This email is:   [ ] bloggable    [ x ] ask first   [  ] private

michael kamleitner

unread,
Jul 16, 2010, 9:49:50 AM7/16/10
to foursquare API
+1 for pubsubhubbub from me too :)

as for scaling-issues: why not user something like superfeedr.com?

regards,
michael

kalle volkov

unread,
Aug 10, 2010, 9:39:17 AM8/10/10
to foursquare API
hi!

if the voting is still on then +1 from me to pubsubhubbub :)

best regards,
kalle


On Jul 16, 4:49 pm, michael kamleitner <michael.kamleit...@gmail.com>
wrote:

Mark Atwood

unread,
Aug 11, 2010, 4:26:36 PM8/11/10
to foursqu...@googlegroups.com
+1 Pubsubhubbub with ActivityStrea.ms 

Mehdi

unread,
Aug 27, 2010, 11:57:00 PM8/27/10
to foursquare API
I would love support for pubsubhubbub for my service www.jelydo.com
too!

On Aug 11, 1:26 pm, Mark Atwood <m...@mark.atwood.name> wrote:
> +1 Pubsubhubbub with ActivityStrea.ms
>
> On Wed, Jun 16, 2010 at 6:46 AM, Anthony Broad-Crawford <
>
>
>
> anth...@anthonybroadcrawford.com> wrote:
> > +1 for Pubsubhubbub with ActivityStrea.ms
>
> > Anthony Broad-Crawford
> > Vice President and Chief Technology Officer @ Within3
>
> >www.anthonybroadcrawford.com
> >www.twitter.com/broadcrawford
>
> > This email is:   [ ] bloggable    [ x ] ask first   [  ] private
>

Phil Leggetter

unread,
Aug 31, 2010, 8:30:53 AM8/31/10
to foursquare API
PubSubHubbub would definitely be really useful as an API option. The
only problem I have with this is that as a consumer (PubSubHubbub
subscriber) it doesn't scale all that well. This is why Twitter have
gone with a streaming API. I use the Twitter streaming API and use a
number of filters to get updates for specific users and updates that
match certain hashtags or keywords (you can see an example here:
http://kwwika.com/Standalone/Demos/javascript-examples/simple-twitter-subscriber/).
This works unbelievably well and the constant streaming connection
scales much better than having multiple HTTP hits on your web server.

That said I think Superfeedr are offering a really good PubSubHubbub
service. They also offer an XMPP API. Maybe this scales in a better
way for the consumer, maybe this uses a persistent connection and
would be better for scaling. So XMPP might be worth considering when
the decision is made about a real-time API. Failing that, maybe using
an external real-time data sharing service such as Kwwika (disclaimer:
which I'm working on) might be an option.

Nathan Folkman

unread,
Aug 31, 2010, 8:48:30 AM8/31/10
to foursqu...@googlegroups.com
In terms of a streaming API, what end points would folks be interested
in seeing? Example: All checkins at a particular venue.

Sent from my iPhone

Phil Leggetter

unread,
Aug 31, 2010, 9:34:50 AM8/31/10
to foursquare API
I've not really looked at the current API at all but I'm hoping my
assumptions aren't all that out. A few off the top of my head and
based on http://dev.twitter.com/pages/streaming_api_methods#statuses-filter

1) All checkins for users e.g. http://stream.foursquare.com/filter?users=userId1,userId2,userId3
2) All checkins for specific venues e.g. http://stream.foursquare.com/filter?venues=venueId1,venueId2
or whatever can be used to uniquely identify a venue
3) All checkins that match a keyword e.g.
http://stream.foursquare.com/filter?track=food,film,movie,cinema
4) All checkins within a distance of a lat-long e.g.
http://stream.foursquare.com/filter?location=56.471021,-2.897411,1000
(lat,long,within metres)
5) You could combine the above too for a finer grained search

Hopefully this is some good food for thought. I think the Twitter
streaming API is a good one to look at and compare since it's clearly
been successful. I've not looked at the UserStreams (http://
dev.twitter.com/pages/user_streams) or Site Streams (http://
dev.twitter.com/pages/site_streams) API yet but I'm assuming it'll be
very similar. I also find it really easy to use. I actually use the
JSON format and consume the data using a .NET Application. You can
find the code here: http://github.com/kwwika/kwwika-tweet-streamer/tree/master/TweetStreamer/

On Aug 31, 1:48 pm, Nathan Folkman <nathan.folk...@gmail.com> wrote:
> In terms of a streaming API, what end points would folks be interested
> in seeing? Example: All checkins at a particular venue.
>
> Sent from my iPhone
>
> On Aug 31, 2010, at 8:30 AM, Phil Leggetter <p...@leggetter.co.uk> wrote:
>
>
>
> > PubSubHubbub would definitely be really useful as an API option. The
> > only problem I have with this is that as a consumer (PubSubHubbub
> > subscriber) it doesn't scale all that well. This is why Twitter have
> > gone with a streaming API. I use the Twitter streaming API and use a
> > number of filters to get updates for specific users and updates that
> > match certain hashtags or keywords (you can see an example here:
> >http://kwwika.com/Standalone/Demos/javascript-examples/simple-twitter...).

Dave Ingram

unread,
Aug 31, 2010, 10:26:11 AM8/31/10
to foursqu...@googlegroups.com, Phil Leggetter

> 4) All checkins within a distance of a lat-long e.g.
> http://stream.foursquare.com/filter?location=56.471021,-2.897411,1000
> (lat,long,within metres)

Just a thought... radius calculations are relatively expensive to do --
I believe Twitter do a rectangle instead.


D

MultiOSuser

unread,
Aug 31, 2010, 10:38:34 AM8/31/10
to foursqu...@googlegroups.com

Personly I wouldn't mind stream on venue checkins but I don't like user streams(unlease they are a friend with the authicated user) or streams by geo radias or venue tags/catagories, as I think that to many users will not like the exposed checkins.

On Aug 31, 2010 9:26 AM, "Dave Ingram" <da...@dmi.me.uk> wrote:


> 4) All checkins within a distance of a lat-long e.g.

> http://stream.foursquare.com/filter?locati...

Just a thought... radius calculations are relatively expensive to do --
I believe Twitter do a rectangle instead.


D


--

To post to this group, send email to foursqu...@googlegroups.com

http://groups.google.com/group...

Julien Genestoux

unread,
Sep 1, 2010, 8:41:56 AM9/1/10
to foursquare API
Hey,

Thanks Phil for sending me here.

I think PubSubHubbub support would be really cool! However, I agree
there are certain things that need to be taken care of before. The
main one should be privacy.

I would love that 4sq does that for both individual user feeds and
location feeds. I don't think it's a good idea to do it for "inbox"
feeds (checkins of my friends).

There are multiple ways to deal with privacy. 4sq has feeds already
using the "obfuscation" technique (used by LinkedIn, Google Reader ...
and many many others too). There is also a way to hide personal
information in feed, but allow them to be consulted on the site for
logged in users.

The most simple way would be an OPT-IN in the settings : make my
checkins public with a big warning, so people who actually want this,
can use it.

As for location filtering, 4SQ could either do it or use a provider
who does it :) Like http://superfeedr.com.
We do a geobox filtering with different box size, which allows for
stuff like "all checkins within k Km (Metric system FTW!) or X,Y".
Even if we use "square" boxes, there is an ultimate filtering that is
done when a point in a box matches.

I pitched Harry and Nathan about all this a few weeks ago. I'd love to
see it happen and I don't think the issue is technological, but more
"business" related, which is why I think we should involve business
people in this discussion.

Cheers!

Ju





On Aug 31, 10:38 am, MultiOSuser <multiosu...@gmail.com> wrote:
> Personly I wouldn't mind stream on venue checkins but I don't like user
> streams(unlease they are a friend with the authicated user) or streams by
> geo radias or venue tags/catagories, as I think that to many users will not
> like the exposed checkins.
>

Mick Thompson

unread,
Sep 1, 2010, 6:12:07 PM9/1/10
to foursquare API
Either PubSubHubbub or XMPP +1

Venues, users, and locations filters are needed for sure. But I would
like to see an full stream of public checkin data as well, we'd love
to surface that data in realtime search.

If the 4sq team would like to talk about any of the experiences we've
had with scaling real-time streams, We'd be happy to chat.


Mick
mi...@collecta.com


On Sep 1, 5:41 am, Julien Genestoux <julien.genest...@gmail.com>
wrote:
> Hey,
>
> Thanks Phil for sending me here.
>
> I think PubSubHubbub support would be really cool! However, I agree
> there are certain things that need to be taken care of before. The
> main one should be privacy.
>
> I would love that 4sq does that for both individual user feeds and
> location feeds. I don't think it's a good idea to do it for "inbox"
> feeds (checkins of my friends).
>
> There are multiple ways to deal with privacy. 4sq has feeds already
> using the "obfuscation" technique (used by LinkedIn, Google Reader ...
> and many many others too). There is also a way to hide personal
> information in feed, but allow them to be consulted on the site for
> logged in users.
>
> The most simple way would be an OPT-IN in the settings : make my
> checkins public with a big warning, so people who actually want this,
> can use it.
>
> As for location filtering, 4SQ could either do it or use a provider
> who does it :) Likehttp://superfeedr.com.
Reply all
Reply to author
Forward
0 new messages