Dear Foursquare: A SMS User’s Wish List

Dear Foursquare,

After 550 check-ins to date, primarily via SMS, I have a wish list of enhancements that would make Foursquare via SMS so much easier to use.

First a little background.  I’m a huge fan of the service and want it to succeed, but the SMS experience is frustrating at best.  The biggest problem is getting the SMS check-in to link up with the corresponding Foursquare venue.  I know I’m not alone as I see similar problems reported on the Get Satisfaction support site and a Twitter search turned up some frustrated comments as well.

I realize SMS users probably make up a tiny percentage of the overall Foursquare user base.  I know the apps for the iPhone and Android devices provide a much better experience.  But at its core, Foursquare is about sharing your location with friends and I think this functionality is achievable with any mobile device.

SMS is like the mobile equivalent of the command line on the PC.  Ultimately a simple yet extremely powerful way of interacting with computer systems.  Fred Wilson wrote about the importance of SMS last summer, calling it the least common denominator for mobile apps.

I think it is critical, particularly early on in the commercialization of a mobile web service, for there to be an easy and quick SMS interface.

For your consideration, here is my wish list:

  • Allow user to change location via SMS.  If you are traveling to different cities (even suburbs) and the venue you want to check-in to doesn’t match your current city, the check-in fails.
    • Could be as simple as texting your city or zip:  “in Minneapolis, MN” or “in 55415″
  • If a check-in isn’t recognized, send back a list of close venue matches.  If I see the right venue, let me text back the number from the list and check me in there instead.
  • If I don’t see the venue I want in the results, post my raw check-in anyway (it does this today), but then on the history page let me go back later and link my raw check-in to the correct venue.
  • Better SMS documentation would help tremendously.  SMS users have pieced a lot together through trial and error, but it would be great to know how some things are working in the background.
    • For example, I’ve heard there are aliases for venues and I have seen old venue names work from time to time, but it would be helpful to know exactly how this works.

I know there are higher priorities for a fast growing startup with limited resources, but I think a great SMS experience is an important component of the product and it can help grow and maintain the Foursquare user base.  If there is any way I can help improve the SMS experience let me know.

If you are a Foursquare user that shares these frustrations leave a comment here or on the corresponding post on Get Satisfaction.

Share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter

The Strokes Use Twitter To Hype Secret Show

After a long hiatus, The Strokes are now working on their fourth album and announced a series of festival appearances for 2010.  Their long dormant Twitter account came to life in May and they have been using it to build buzz as they work on the album and return to the stage this summer.

The last few weeks the account posted teaser pictures of gear and rehearsals.  This week they cleverly used Twitter to provide clues to a somewhat secret warm-up show in London ahead of their first shows back this weekend at Isle of Wight and RockNess.  They first announced they were in London and then posted a play on their logo with the name VenisonA photo of Camden Lock came next and fans put the pieces together and found a band called “Venison” on the schedule at Dingwalls located in Camden.

It didn’t take long for numerous music websites like NME and Brooklyn Vegan to spread the word.  This is a great example of using Twitter to generate instant buzz.  It’s an interactive and fun way to engage with fans everywhere and all it took was a couple pictures.  I hope they do a show or two like this in the U.S. this year.

Share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter

Barrio Hosting Twin Cities Foursquare Meetup

Barrio in Lowertown St. Paul is hosting a Foursquare meetup on Wednesday, May 26th.  They are offering free drinks with every food purchase and if enough people come by a Swarm Badge might get unlocked too.  All the event details are on their Facebook page.

Events like this are a great way for restaurants and bars to generate business and connect with customers.  Pazzaluna, also in St. Paul, did a similar event a few months ago and AJ Bombers of Milwaukee is one of the best success examples I have seen so far.  If you know of other events like this in the Twin Cities let me know.

Share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter

Getting Started With Windows 7 Gadgets

I spent the last few days playing with gadgets in Windows 7 and learning the basics to build one.  The basic structure is surprisingly simple, requiring only an XML configuration file and a HTML file for the UI and logic.  Gadgets are actually just little web applications running inside of Internet Explorer, so they can leverage CSS and JavaScript as well.

I found a few good gadget tutorials to get started:

Here is a quick tutorial for building a gadget.  I’m doing this in Windows 7, but I think it will work on Vista too.

  • Navigate to C:\Users\YourUserName\AppData\Local\Microsoft\Windows Sidebar\Gadgets
  • Create a folder called HelloWorld.gadget
  • In the folder create a file called gadget.xml and helloworld.html

Add the following code to gadget.xml:

<?xml version="1.0" encoding="utf-8"?>
<gadget>
  <name>Hello World</name>
  <version>1.0.0.0</version>
  <author name="Your name">
    <info url="http://www.mysite.com/my-gadget" text="mysite.com"/>
  </author>
  <copyright>&#169; 2010</copyright>
  <description>This gadget says hello!</description>
  <hosts>
    <host name="sidebar">
      <base type="HTML" apiVersion="1.0.0" src="helloworld.html"/>
      <permissions>Full</permissions>
      <platform minPlatformVersion="1.0"/>
    </host>
  </hosts>
</gadget>

Add the following code to helloworld.html:

<html>
<script type="text/javascript">
function DoInit() {
    document.body.style.width = 90;
    document.body.style.height= 55;
    document.body.style.margin=0;
}
</script>
<body onload="DoInit();">
<br>
<center>Hello World!</center>
</body>
</html>

After code is added to those files you can try the gadget out.  Go to Control Panel\All Control Panel Items\Desktop Gadgets and you should see your newly created gadget.  Give it a click and it will pop up on the side of your screen.  That’s all there is to creating a simple gadget.  Obviously this gadget isn’t incredibly useful, but it gives you the basic idea to build on.

Share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter

How To Use The Foursquare API With OAuth And PHP

I started playing with the Foursquare API and one of the first things you need to do is figure out how to authenticate with Foursquare to make calls to the API. It took me awhile to figure this out and start making successful calls, so I thought others could benefit from a detailed tutorial. The goal of this tutorial is to demonstrate how to make calls to the Foursquare API using OAuth authentication and PHP. Foursquare has a helpful API discussion group I recommend checking out. Here are a few starting points that are helpful for this tutorial:

Setup your environment

Here is what you’ll need to complete this tutorial:

To begin, setup a project folder on your web server with the necessary files for this example.

Create a folder called “test” and create files inside that folder called index.php and callback.php. Then download the foursquare-async library (click “Download Source” in the upper right corner). Extract the files EpiCurl.php, EpiFoursquare.php and EpiOAuth.php to the test folder.

You now should have a folder called test that is accessible via a browser that contains these files:

  • index.php
  • callback.php
  • EpiCurl.php
  • EpiFoursquare.php
  • EpiOAuth.php

Note: Depending on your server configuration you may need to manually enable cURL support. I did this example using XAMPP and needed to turn it on. In the php.ini file (C:\xampp\php\php.ini) uncomment the line “extension=php_curl.dll” and then restart Apache. If you get an error like this later in the tutorial it might indicate you need to enable cURL.

Possible cURL error:
Fatal error: Call to undefined function curl_multi_init() in C:\xampp\htdocs\test\EpiCurl.php on line 24

OAuth overview

You can authenticate with Foursquare’s API in one of two ways. The simpler, but less secure way is through basic access authentication. This method requires the user to provide their credentials (username/password) to your application and those credentials get passed right in the web request to the API. It gets the job done, but makes the user’s data more vulnerable. The user is also trusting that the application is storing their credentials securely.

The more secure option we will use in this example is OAuth authentication. OAuth does a better job of protecting the user’s credentials and also gives the user greater control over what applications have access to their account. For example, instead of giving a random application your Foursquare credentials, you instead click on a link within the application that sends you to Foursquare to provide your credentials. Then Foursquare sends you back to the application with appropriate access keys for the application to use. Authenticating this way means that your credentials stay between you and Foursquare. The application you are giving access to only gets the OAuth access keys and doesn’t see or store your actual Foursquare credentials. It sounds complicated, but hopefully this tutorial will clear it up a little. OAuth is becoming more of a standard and as an end user you are probably already authenticating with different applications and web services this way.

Here are the steps for the OAuth workflow that this example will accomplish:

  1. Get request key and secret
  2. Provide a link to the Foursquare authorization page
  3. The user will approve or deny access and be redirected back to your application
  4. Get access key and secret (and store in your application database, but we don’t need to for this example)
  5. Use access key and secret to make API calls

Register with Foursquare to get your key and secret

The first thing we need to do is register our application with Foursquare to get a request key and secret for our application.  Go to http://foursquare.com/oauth/register, login and fill in the required information.

  • Application Name:  OAuth Test
    • Give your application a name (My Foursquare App)
  • Application Web Site:  http://localhost/
    • Provide the site where you will host your application (www.mysite.com/my-foursquare-app)
  • Callback URL:  http://localhost/test/callback.php
    • This is the URL that Foursquare will send the user to after authenticating (www.mysite.com/my-foursquare-app/callback.php)

Click “Register” and Foursquare should generate a new key and secret for your application.  Your key and secret will be different than mine.

You can always return to http://foursquare.com/oauth/ to change these details or reset your key and secret.  At this point your application is registered and you have a key and secret to use.

Add code to the index.php file

The second task is filling in the index.php file with some code.  Open up index.php and add the following code.  Also if you are curious I am using the SyntaxHighlighter Evolved plug-in for displaying code.

<?php

//Put in the key and secret for your Foursquare app
//Your values will be different than mine
$consumer_key = "XB1NE31CJ4U22EF2GA53C4ULR3SL2BG21G1M5VTRCZ3K1XW5";
$consumer_secret = "3RHRD1KJLGFFHKDMD4SCE11NHNDCFUPOIPOQW4VGKLADFKC1";
$loginurl = "";

//Includes the foursquare-asyc library files
require_once('EpiCurl.php');
require_once('EpiOAuth.php');
require_once('EpiFoursquare.php');

session_start();
try{
  $foursquareObj = new EpiFoursquare($consumer_key, $consumer_secret);
  $results = $foursquareObj->getAuthorizeUrl();
  $loginurl = $results['url'] . "?oauth_token=" . $results['oauth_token'];
  $_SESSION['secret'] = $results['oauth_token_secret'];
} catch (Execption $e) {
  //If there is a problem throw an exception
}

echo "<a href='" . $loginurl . "'>Login Via Foursquare</a>";  //Display the Foursquare login link
echo "<br>";
//This is your OAuth token and secret generated above
//The OAuth token is part of the Foursquare link above
//They are dynamic and will change each time you refresh the page
//If everything is working correctly both of these will show up when you open index.php
var_dump($results['oauth_token']);
echo "<br>";
var_dump($_SESSION['secret']);

?>

Now open index.php in your browser and you should see the following, only your two values will be different.

Add code to the callback.php file

Before you go to the login link you created, we need to add code to the callback.php file.  Now open that one and add this code.

<?php

//Put in the key and secret for your Foursquare app
//Your values will be different than mine
$consumer_key = "XB1NE31CJ4U22EF2GA53C4ULR3SL2BG21G1M5VTRCZ3K1XW5";
$consumer_secret = "3RHRD1KJLGFFHKDMD4SCE11NHNDCFUPOIPOQW4VGKLADFKC1";

//Includes the foursquare-asyc library files
require_once('EpiCurl.php');
require_once('EpiOAuth.php');
require_once('EpiFoursquare.php');

session_start();
$foursquareObj = new EpiFoursquare($consumer_key, $consumer_secret);
$foursquareObj->setToken($_REQUEST['oauth_token'],$_SESSION['secret']);
$token = $foursquareObj->getAccessToken();
$foursquareObj->setToken($token->oauth_token, $token->oauth_token_secret);

try {
   //Making a call to the API
   $foursquareTest = $foursquareObj->get_user();
   print_r($foursquareTest->response);
 } catch (Exception $e) {
   echo "Error: " . $e;
 }

?>

Test it out

Now we are ready to try it all out and make a call to the Foursquare API.  This first call is going to bring back your user information.

Open up index.php in your browser again and click the login link.  This is the part where the user leaves your application and goes to authenticate with Foursquare directly.

Notice that your OAuth token is along for the ride in the URL:

Click on “Allow” and Foursquare will send the user to the callback page you created.

If everything worked correctly you will see your user information in the browser.

Try a few more API calls.  This will call back your check-in history:

//Making a call to the API
$foursquareTest = $foursquareObj->get_history();
print_r($foursquareTest->response);

If you want to make a call with parameters it looks like this.  This will get your user information along with your badges and mayorships:

//Making a call to the API
$params = array("badges"=>1, "mayor"=>1);
$foursquareTest = $foursquareObj->get_user($params);
print_r($foursquareTest->response);

As you look through the API documentation you will notice the different methods described like this:

URL: http://api.foursquare.com/v1/venue
Formats: XML, JSON
HTTP Method(s): GET
Requires Authentication: No, but recommended
Parameters:

  • vid – the ID for the venue for which you want information

To call the venue details method above in our example we just need to change a couple things.  We know this method takes in the single parameter vid and we can grab a venue’s ID from its Foursquare URL.  22242 in my example corresponds to the venue Town Talk Diner.  On the next line, combine the HTTP method (GET) with the method name from the URL (venue) to form get_venue.

//Making a call to the API
$params = array("vid"=>22242);
$foursquareTest = $foursquareObj->get_venue($params);
print_r($foursquareTest->response);

Note that every time you go through this process and click “Allow” Foursquare adds another entry for your application.  You can go to your Foursquare settings page to clean these up.  If you were building out an application you would want to save the user’s OAuth information in a database so they don’t have to re-authenticate each time.  For this example the OAuth information is just getting placed in a temporary browser session and thus we have to re-authenticate each time.

Hopefully at this point you are making calls to the API and getting data back.  To go beyond these basic calls refer to the Foursquare API documentation to see everything that is available.  Also refer to the wiki page for the foursquare-asyc library to learn more about how it works.

Share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter