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

Foursquare WordPress Plugin

Update (March 23, 2010): I updated the version to 0.3 officially, and fixed some links. I need to really make this better. Hopefully I will have some time soon!

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

Usage (version 0.3)

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]
  • 0.3 – Fixes broken URL. I need to really make this a better plugin, and integrate the 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

  • Jin
    the page is missing...
  • The rss shows it is fetching recent data, but perhaps the plugin is not?
  • This is awesome. Would love to see something similar for facebook.
  • Ths for your post, it's very important to me.
  • thanks for you share,really good information for us!
  • Bickelt
    Please disregard my previous question. I found the widget code in 0.4 . It is awesome. Thanks!
  • Bickelt
    Any chance of getting some help installing this using Thesis? Can't seem to find sidebar.php file.
  • The following code should add the widget to the bottom of your sidebar. Please bear in mind I haven't tested this but it will be along these lines and you can change the hook to position it wherever you want.

    Add the following code to your custom functions file:

    function foursquare_thesis_widget() {
    ?>
    <div class="widget">

    </div>
    }
    add_action('thesis_hook_after_sidebars' , 'foursquare_thesis_widget');
  • thanks for you share,really good information for us!
  • Schiker
    how can i integrate the map in my blog?
  • Hey Andrew,

    Really like your plugin - it's so smart! I've made a Foursquare plugin too, which quite simply displays your last check-in details, so it's intended for those who don't want to 'overshare', those who like to hack around with what is/isn't shown, or those who like to keep things clean and simple.

    I'd love a bit of feedback if you don't mind?
    The link is http://digitalcortex.net/plugins/foursquare-map

    All the best,
    Tom
  • Thanks a landlord it! I acquired yet some insight. Life is so colorful, we should be able to live in, such as Korea and honor the planet. Human life is like rivers, slowly flowing, flowing rivers, flowing through the snow, flows through the prairie and ultimately into the sea, return to the embrace of nature, start a new reincarnation. Allow us to feel the meaning of life will come only to those you have those memories http://www.cheap-nikeshox.com/nike-shox-TL1.html
  • Enci
    I can't download the plugin. Takes me to a page that says that the page I'm requesting doesn't exist. :-( Can you reply back with the correct link?
  • The blog is great
  • wow so nice
  • This blog is very good!
  • ggg
    Please can you update & support buddypress CMS (wordpress network) www.buddypress.org
  • sdfdsfs
  • I just wanted to let you know I am excited to try your code out. It took me a little bit to find the correct download. Most of the links on this page are messed up.

    Finally located your main github page.

    http://github.com/mager/
  • alex
    I get this too, what should I do?

    "Incompatible archive PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure"
  • CJL
    Getting a page doesn't exist error when trying to download...
  • I don't see this plugin in my widgets list. What gives?
  • I'm getting the "Incompatible archive PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure" mentioned below- really frustrating :( Any advice?
  • yellowxboy
    same here :/
  • The plugin is awesome. I don't think you need to make it any better then it already is. =)
  • wholesaleelectronics
    Here have a variety of advanced technology to produce electronic products,Most wholesale electronics today use semiconductor apparatus to accomplish electron control. The abstraction of semiconductor on wholesale electronics and accompanying technology is advised a annex of physics, admitting the architecture and architecture of cyberbanking circuits to break applied problems appear beneath go to wholesale electronicsengineering. This commodity focuses on engineering aspects of electronics.
    wholesale electronics go! is a able manufacturer, specializes in development, manufacture. We accept broad Cheap Consumer Electronics, China Broad Electronics: Like Cheap Unlocked Cell Phones, Hiphone, MP3 Players, MP4 Players, MP5 Players, Computer Accessories, Car Electronics, Bluetooth Products, USB Flash Drive, Memory Cards, Health & Beauty, iPod & iPhone Accessories, Digital Photo Frames,Car Audios, Car DVD Players, Digital Cameras, Digital Camcorders, Video Game Accessories, Spy Cameras, Security Products and Electronic Gadgets from China.
    We accept over 2500 accomplished and accomplished advisers and our accessories of 7,300 aboveboard meters are able with avant-garde productions and testing machines. We accept the absolute superior ascendancy arrangement and strive to accommodated and beat our customer's expectations,wholesale electronics.
    Do you find mbt lami shoes for a long time. Here is the richest in the world and you can find your needs bring you harvest. yes,
    mbt lami shoesPurple Shoes is the first physiological footwear that has a positive effect on the whole body.
    buy mbt lami shoes's sole is curved, not flat. Anti-shoe is unstable, not stable. Swissmasai activates your muscles instead of undermining them. The
    buy mbt lamiBirch Shoes Chapa feature feature rich nubuck leather with single-layer mesh upper bodies for strong but breathable wear,
    mbt lami.
  • jehzeel
    wow great! thanks for creating this plugin! yipeeeeeee!
  • hwy
    I'm using widgets rather than adding to sidebar.php, and while I set "" into the text/html widget, nothing is showing up in my sidebar, where it should be.

    The rss shows it is fetching recent data, but perhaps the plugin is not? Or is it just not compatible with widgets at this time?
  • Timothy
    Would it be possible to allow the plugin to track multiple people? Perhaps 30 or 40 students in a club?
  • 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...
  • ryanmooreswd
    Can you please send this to me? I can't use the simplexml_load_file either, I get an error message. ryan@simplicitywebdesign.com.au
  • 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