A genuine Silicon Valley Web Flyer | One line of code at a time...

Foursquare Wordpress Plugin

Update (November 17th, 2009): The plugin hasn’t been updated in a few months, so the API may have changed. I will try to tackle version 0.3 this weekend if I have some time.

This is my first plugin, so let’s see how it goes!

Usage (version 0.2)

Download the zip file and extract the contents to your wp-content/plugins directory. In your blog’s admin tool, activate the plugin.

Next, login to Foursquare and goto the feeds page. Find your RSS feed.

Copy it to the clipboard, and paste it into the Foursquare settings panel.

Finally, paste the following code in your sidebar.php file in Wordpress:

<?php echo foursquare_get_checkins(); ?>

Here is the working version of the plugin in action:

Pretty basic now, but there will be further revisions, I promise :)

Downloads and version history

  • Version 0.1 – Simple widget showing the latest 5 checkins with links back to venue pages – [download]
  • 0.2 – Added the ability to control the number of checkins you post. Also cleaned up the code a little bit. Still want to figure out how to eliminate duplicate checkins via strcmp() or array_unitque() functions in PHP. I want to add a Google map with the kml file and show checkins on a map – [download]

In further versions, I want to explore the Wordpress widget API. Instead of this being a plugin where you have to actually paste PHP code into your sidebar, I want to bring all the interaction into the admin panel.

I welcome further requests please! Email me or leave some comments below.

Here is the git repository for my Wordpress plugins.

Note: this blog post is still a work in progress, check back periodically for updates

  • peter_gent
    I got a Incompatible archive PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure on automatic install... ? thoughts/ Help?
  • Is this plugin still being developed?
  • Thanks. Now let me try this plugin.

    I am shopping for good plugins and trying some, deleting some. I'll let you know how this one works :-)
  • This is awesome! We need some updates!
  • I have done a foursquare plugin to fetch locations, with relative timestamps, widgets support, etc... and then discover your plugin. I like the use of the simplexml_load_file, but I use another approach (because simplexml_load_file is PHP5 only).
    So, if you tell me your email I can send you all my code (well, is not much code) so you can take it and adapt it to your plugin, if you you want...
  • I like this post its preety cool very nice and helpful as well as informative post. Thanks for the post.
  • It would be awesome to be able to have the option for a relative timestamp alongside the linked places.
  • lunalot
    The feeds page is now at http://foursquare.com/feeds .
  • Hi, how do I get your widget on this site...with the map of locations. Thanks!
  • crl
    I can't seem to find the "Foursquare Settings Panel" where I paste my RSS URL.? any help is appreciated - thnx
  • hi, unable to install. It gives the following error message "Incompatible archive PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure"
  • Having trouble downloading v.2, any tips?

    Thanks Andrew! pumped to use this!
  • The download link does not work...
  • hi there, download isn't working any more? I'd LOVE to list foursquare the way you have it on this page, with the list AND the map. map being essential... thanks in advance, this plugin is a fabulous idea!
  • What I can say is very nice and helpful as well as informative post...really help me very much more!! Thanks..
    Cheers,
    gadgettechblog.com
  • That's pretty cool! I wonder if Loopt knows about this?
  • UncoolJohn
    This is awesome. Would love to see something similar for facebook.
  • chinawholesale
    You were prescient with adding video to WP back in 06-07. http://www.trademic.comI’ve come late to the party but things are still evolving and many people are still waiting to jump in. Plus there are so many more hosting platforms to use now.
  • I think I'm completely retarded right now, but I can't seem to find the "Foursquare Settings Panel" where I paste my RSS URL! The only option for editing the plugin is the "Edit" link next to "Deactivate," but it only takes me to literally edit the foursquare.php file.

    Edit - nevermind, I found it :) Great plugin, mager!
  • crl
    Hi Wendyness or anyone - I am having the same problem! Where did you find the place to add the RSS URL in the settings panel? I am on the settings panel in foursquare but there does not seem to be a place that looks similar to the directions above.. thanks CL
  • Thanks Naveen. Look for many more updates to the plugin as I learn the ins and outs of Wordpress.
  • love this. thank you. we'll post it up all over
blog comments powered by Disqus