I DO!  And from the sound of it on various blog posts and Foursquare’s Get Satisfaction page, a lot of other Foursquare users do as well.  Foursquare is fun for awhile, checking in everywhere you go, getting mayorships and notifications of where your friends are at.  But a big part of the fun for a lot of people is getting the badges.  Checking in after while gets old without any incentive.  Especially if you’re checking into multiple applications.  When you’ve got Foursquare, Gowalla, Brightkite, LooptStar, CauseWorld, and Whrrl all on your phone (as I do), and you’ve only got a few seconds to checkin, which app are you going to choose?    For me, its the one that’s the most fun and provides some type of  incentive.  Foursquare’s mayorships and badges provide that nice little gaming element without going overboard.

The problem is, Foursquare’s badges are fairly limited and many are impossible to get for the majority of users.  There are a lot of tech event specific badges and a lot of New York badges.  There seems to be no love for the West coast (only 2 San Francisco badges, and 1 Vancouver, Canada badge).  As a Seattleite and someone who doesn’t go to big tech events, I feel very left out.  For sure, there are a lot you who feel the same way.

So Osnapz now has custom-made Foursquare badges for you to earn!

Seattle Skyliner

What a beautiful view, that Seattle skyline. Yeah, you know the best spots to see it!

Seattle’s gotta have it’s own Foursquare badge, so here’s one for Seattle Foursquare fans.  Check into some of Seattle’s best viewpoints to get this (you’ll have to figure out how many and where).

Marihawks

You're a true Seattle sports fan...checking into both Qwest Field and Safeco Field.

Ok Seattle’s gotta have another one.  Mariners, Seahawks, and/or Sounders FC fan?  Then this one should be a breeze for you.

Pho’ster

You really love your hot bowl of Pho, but then again who doesn't?

This is for everyone who loves pho!  You’ve gotta really love pho to get this.

General Tso’s

Nom nom, love that General Tso's and hot and sour soup!

For the Chinese food fans, this is for you.  You don’t have to have ordered General Tso’s chicken to get this, any Chinese food will do!

Consider this an add on to your current Foursquare experience.  To get started, first join Osnapz and link your Foursquare account. Then follow the Osnapz account. If you’re a Twitter and Facebook fan as well, you may even get the Double-O-Snapz badge as well!

What other Foursquare badges would you like to see? If you have suggestions for new Foursquare badges you’d like to see us make, feel free to suggest it on our Get Satisfaction page. We plan on releasing several new badges every month!

For Businesses

Do you have a Foursquare venue and want to reward checkins and mayorships with your own branded Foursquare badges? You can do that with Osnapz too. Find out more at Osnapz for Business and register for the private beta!

Advertisements

In case you haven’t already heard, Facebook just released their new Graph API at f8.  Its good news for us developers, as the new API is much cleaner and simpler to use than their old REST API.  The great news is that Facebook now supports OAuth 2.0 for authentication instead of their own custom authentication mechanism.  The really great news is that OAuth 2.0 is super simple to use.  If you’ve used OAuth 1.0a before, you know it can be a little tricky, with the request tokens and generating signatures and such.  Well OAuth 2.0 simplifies all that, and makes using the Graph API super simple. You can read Facebook’s documentation here: http://developers.facebook.com/docs/authentication/ .

There’s example code there, but its in PHP and Python, which of course is not very useful for .Net developers.  So here’s all the code you need to get running in C#.

Create a class, called oAuthFacebook.cs. A lot of this code came from a Twitter OAuth example, which I’ve modified for Facebook and OAuth 2.0:

public class oAuthFacebook

{
public enum Method { GET, POST };
public const string AUTHORIZE = "https://graph.facebook.com/oauth/authorize";
public const string ACCESS_TOKEN = "https://graph.facebook.com/oauth/access_token";
public const string CALLBACK_URL = "http://www.blahblah.com/facebookcallback.aspx";

private string _consumerKey = "";
private string _consumerSecret = "";
private string _token = "";

#region Properties

public string ConsumerKey
{
get
{
if (_consumerKey.Length == 0)
{
_consumerKey = "1111111111111"; //Your application ID
}
return _consumerKey;
}
set { _consumerKey = value; }
}

public string ConsumerSecret {
get {
if (_consumerSecret.Length == 0)
{
_consumerSecret = "11111111111111111111111111111111"; //Your application secret
}
return _consumerSecret;
}
set { _consumerSecret = value; }
}

public string Token { get { return _token; } set { _token = value; } }

#endregion

/// <summary>
/// Get the link to Facebook's authorization page for this application.
/// </summary>
/// <returns>The url with a valid request token, or a null string.</returns>
public string AuthorizationLinkGet()
{
return string.Format("{0}?client_id={1}&redirect_uri={2}", AUTHORIZE, this.ConsumerKey, CALLBACK_URL);
}

/// <summary>
/// Exchange the Facebook "code" for an access token.
/// </summary>
/// <param name="authToken">The oauth_token or "code" is supplied by Facebook's authorization page following the callback.</param>
public void AccessTokenGet(string authToken)
{
this.Token = authToken;
string accessTokenUrl = string.Format("{0}?client_id={1}&redirect_uri={2}&client_secret={3}&code={4}",
ACCESS_TOKEN, this.ConsumerKey, CALLBACK_URL, this.ConsumerSecret, authToken);

string response = WebRequest(Method.GET, accessTokenUrl, String.Empty);

if (response.Length > 0)
{
//Store the returned access_token
NameValueCollection qs = HttpUtility.ParseQueryString(response);

if (qs["access_token"] != null)
{
this.Token = qs["access_token"];
}
}
}

/// <summary>
/// Web Request Wrapper
/// </summary>
/// <param name="method">Http Method</param>
/// <param name="url">Full url to the web resource</param>
/// <param name="postData">Data to post in querystring format</param>
/// <returns>The web server response.</returns>
public string WebRequest(Method method, string url, string postData)
{

HttpWebRequest webRequest = null;
StreamWriter requestWriter = null;
string responseData = "";

webRequest = System.Net.WebRequest.Create(url) as HttpWebRequest;
webRequest.Method = method.ToString();
webRequest.ServicePoint.Expect100Continue = false;
webRequest.UserAgent  = "[You user agent]";
webRequest.Timeout = 20000;

if (method == Method.POST)
{
webRequest.ContentType = "application/x-www-form-urlencoded";

//POST the data.
requestWriter = new StreamWriter(webRequest.GetRequestStream());

try
{
requestWriter.Write(postData);
}
catch
{
throw;
}

finally
{
requestWriter.Close();
requestWriter = null;
}
}

responseData = WebResponseGet(webRequest);
webRequest = null;
return responseData;
}

/// <summary>
/// Process the web response.
/// </summary>
/// <param name="webRequest">The request object.</param>
/// <returns>The response data.</returns>
public string WebResponseGet(HttpWebRequest webRequest)
{
StreamReader responseReader = null;
string responseData = "";

try
{
responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());
responseData = responseReader.ReadToEnd();
}
catch
{
throw;
}
finally
{
webRequest.GetResponse().GetResponseStream().Close();
responseReader.Close();
responseReader = null;
}

return responseData;
}
}

Add a login button to your .aspx page:

protected void btnLogin_Click(object sender, EventArgs e)
{
oAuthFacebook oFB = new oAuthFacebook();
Response.Redirect(oFB.AuthorizationLinkGet());
}

Create a callback page, call it FBCallback.aspx or whatever:

protected void Page_Load(object sender, EventArgs e)
{
string url = "";
oAuthFacebook oAuth = new oAuthFacebook();

if (Request["code"] == null)
{
//Redirect the user back to Facebook for authorization.
Response.Redirect(oAuth.AuthorizationLinkGet());
}
else
{
//Get the access token and secret.
oAuth.AccessTokenGet(Request["code"]);

if (oAuth.Token.Length > 0)
{
//We now have the credentials, so we can start making API calls
url = "https://graph.facebook.com/me/likes?access_token=" + oAuth.Token;
string json = oAuth.WebRequest(oAuthFacebook.Method.GET, url, String.Empty);
}
}
}

That’s all there is to it!  You can start making Graph API calls by including the  access token with your requests.

I was determined this week to get YouTube added as a supported site on Osnapz, and I’m happy to report that it’s up and running! You’ll now notice a YouTube login button at the top of the screen, along with the Twitter and Facebook login buttons.

Important: If you’re already an Osnapz member, simply login with your Twitter or Facebook account, then go to the “social sites” tab to add YouTube.

If you’re not already an Osnapz member, then go to the registration page, and choose which site (Twitter, Facebook or YouTube) you’d like to sign-up with.

Either way you add YouTube, you’ll be redirected to the YouTube authorization page where you’ll need sign in with your Google/YouTube credentials, then click the “Allow Access” button so that Osnapz can gather your YouTube account data. As with the Twitter and Facebook login, Osnapz will never have access to your password on those sites. It means more security for you, and eases the registration and login process for you.

The first set of YouTube achievement badges are for how many videos you’ve watched! Here are some of them, with a fun movie snack theme!

The second set of YouTube achievement badges are for how many channel or profile views you’ve received. The more views you’ve got, the more eyes the monsters have! Here are a few of them:
The next set of YouTube I’ll be adding will be for the number of subscribers you have, stay tuned for that!