FourSquareAPI Plugin for WordPress

This plugin uses the foursquare® API to retrieve various information and display it in a widget or directly in posts and pages via a shortcode. Information currently available includes …

  • your recent checkins
  • your mayorships
  • your badges
  • your checkin history

To display your selected data in a widget, simply drag the widget to your sidebar and select the options you want to display. Similarly, you can add the widget styled data to a page or post by using the shortcode features (see shortcode pages)

Your foursquare data may be displayed with options to include a map showing the location(s), address details, and statistics relating to the venue. Some data also allows you display a timestamp relating to when the event occurred (such as when you checked in or when you received a badge)

I wanted to show my foursquare® check-ins here on the blog but wasn’t 100% with the few plugins that currently exist … so I wrote my own :)

The map is my favorite feature. Venue icons or badges will be placed on the map and, if selected, on your list of checked in venues or achieved badges. Clicking an icon from the list will move the map to that venue.

To download the plugin, please visit WordPress.org … and don’t forget to rate it once you fall in love with it ;)

If you are currently using this plugin, please let me know your website as I am planning on providing a ‘users wall’ section here.

If you find this plugin useful and would like to assist in further development, please consider making a small donation via PayPal







Write your comment within 199 characters.

 

 
  • http://www.facebook.com/trueblue55 Sam Hansen

    Fantastic work! Just installed it on my Lizard Insider blog!

  • http://www.facebook.com/jinniwbg Jinni Wbg

    I really want to use your plugin but get this error:

    Warning: require_once(/home/web35866/domains/smalochsnygg.se/public_html/wp-content/plugins/foursquareapi/php/Zebra_Image.php) [function.require-once]: failed to open stream: No such file or directory in /home/web35866/domains/smalochsnygg.se/public_html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 54

    Do I need to do something?
    I can't activate the plugin because of this. :(

  • http://www.facebook.com/allanneagle Allan Neagle

    Hi Jinni. Can you let me know please if the upgrade worked for you. Thanks.

  • http://www.facebook.com/jinniwbg Jinni Wbg

    Allan Neagle No I can activate the plugin and pull the widget to the widgetbar. See http://www.smalochsnygg.se
    I get the error:
    Warning: Invalid argument supplied for foreach() in /home/web35866/domains/smalochsnygg.se/public_html/wp-content/plugins/foursquareapi/php/FourSquareAPI.functions.php on line 295

    I made the consumer at Foursquare and set the id and secret but got a error:
    OAuth Authentication Failed. Your server time is not in sync with the FourSquare servers. Talk to your hosting service to see what can be done.

    I talked to my hos but the couldn't se anything wrong. They said that Foursquare can't find the files even though they can see the files.

    Your server time: Wednesday, 02-Nov-11 14:24:23 UTC
    FourSquare's current server time: Wednesday, 02-Nov-11 14:24:23 UTC

    When clicking on Connect to Foursquare I first get to the connect page, when I press allow I get this error:

    Warning: require_once(../php/FourSquareAPI.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/web35866/domains/smalochsnygg.se/public_html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 28

    Fatal error: require_once() [function.require]: Failed opening required '../php/FourSquareAPI.class.php' (include_path='.:/usr/local/php5/lib/php') in /home/web35866/domains/smalochsnygg.se/public_html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 28

  • http://www.facebook.com/allanneagle Allan Neagle

    Jinni Wbg Thanks for the full explanation. I have recoded the way that it handles the FourSquare connection authorization and so the next upgrade should solve the problem. Please upgrade to 1.3.5 as soon as WordPress make it available. (I have just this moment uploaded it)

    Note that if WP says an upgrade to 1.3.4 is available, I have noticed that you need to do that first before 1.3.5 will be available. Not sure why it does that.

  • http://www.facebook.com/jinniwbg Jinni Wbg

    Allan Neagle I really want to use your widget, so excited. =) I can't se the upgrade yet. How long do you think it will take?
    I'm using 1.3.4 now. =)

  • http://www.facebook.com/john.f.kaufman John Kaufman

    Hi, got an error – can you help?

    Warning: copy() [function.copy]: Filename cannot be empty in /home/stagilit/public_html/john-kaufman.com/wp-content/plugins/foursquareapi/php/FourSquareAPI.functions.php on line 336.

  • http://www.facebook.com/allanneagle Allan Neagle

    Which version do you have John?

  • http://www.facebook.com/john.f.kaufman John Kaufman

    Allan Neagle Hi Allan, v1.36 …

  • http://www.facebook.com/allanneagle Allan Neagle

    OK. Looking into it now. FYI … the error seems to be because we can no longer copy the icon in order to shrink it down to a smaller size for the map.

  • http://www.facebook.com/allanneagle Allan Neagle

    John Kaufman Thanks for bringing this error to my attention. I have just uploaded version 1.3.7 which should fix the problem (I say 'should' because unfortunately I cannot recreate the error on my server)

    Please upgrade as soon as your WP-Admin panel allows and let me the results.

  • http://www.facebook.com/john.f.kaufman John Kaufman

    Thanks Allan Neagle, now that's what I call support!! :-)

  • http://www.facebook.com/allanneagle Allan Neagle

    John Kaufman Actually, after looking more at your site I have been able to identify another potential problem where foursquare returns a venue with no data. Updated to version 1.3.8

  • http://stagility.com john_kaufman

    Works like a dream Allan, thank you for your help!! :-)

  • http://www.facebook.com/mkoekenberg Martin Koekenberg

    The maps aren’t displayed on WordPress 3.2.1 with the
    Twenty Eleven 1.2 theme activated.

    What can be wrong?

  • Anonymous

    Thanks Martin. I will investigate but could you please let me know the URL of your site so that I can see what is being returned.

  • Anonymous

    I just set up a dev site using the Twenty Eleven 1.2 theme and all seems to working fine … http://dev.nzguru.net

    Did you remember to set the map dimensions in the widget settings using something like 188px (nb: the px is important. You could also use 100% but ONLY for the width)

  • http://www.facebook.com/mkoekenberg Martin Koekenberg

    Strange.

    Look at this url: http://www.kristianbeijer.nl/foursquare/

  • Anonymous

    Thanks Martin. I have identified the problem (my mistake) as being me forgetting to load the GoogleMapsAPI when only shortcodes are being used. I have now corrected this issue with version 1.4.2.

    Please upgrade as soon as it is available to you and please let me know how things go.

  • http://www.facebook.com/mkoekenberg Martin Koekenberg

    Thanks (I juste upgraded tot 1.4.1).

    I’ll let you know when I upgraded to 1.4.2.

  • Anonymous

    The maps look good now Martin :)

  • http://twitter.com/metzkerei Chris Metzker

    hey…would like to install the plugin but i can’t get past the oauth registration…it keeps telling me that the captcha code doesn’t match the image….but i triple checked it…its the same code…whats wrong with that … :( (

  • Anonymous

    Hi Chris. I don’t actually have a captcha code as part of my plugin so the problem must be with the foursquare registration process. Please contact foursquare themselves describing the issue you are having. Sorry.

  • http://twitter.com/metzkerei Chris Metzker

    yap..thats right,its @ the 4sqr page….i’ll contact them … just thought i check you first ..but thx for the fast reply…hope I’ll get it to run

  • http://twitter.com/metzkerei Chris Metzker

    yeeeeeeeah …. it works. i tried it with IE and it worked,and after saving ID and Client about 3 times i was able to connect to 4sqr (after three tries) … finally.

    but one more thing: it shows my checkins even when I check in “off the grid” … is there a chance that i  can hide those (private) checkins??

  • Anonymous

    I didn’t realize that you could checkin privately and I’ve not seen any data to indicate a particular checkin is public or private. Could you let me know please how to do a ‘private’ checkin so that I can see if the data returned is any different.

    If it is at all possible to hide private checkins then I shall certainly add that option.

  • http://twitter.com/metzkerei Chris Metzker

    hm, maybe i got that wrong… but (android) app asks me if i wanna share a checkin with my friends (Share with friends: Y/N, post on FB/Twitter: Y/N) … so if i select no, only i can see the checkin and it tells me “off the grid” … at least i thought that nobody can see those checkins…

  • http://www.facebook.com/mbedell Malcolm Bedell

    I am getting the following errors above the widget. The map and recent check-ins show up fine after that:

    Warning: copy() [function.copy]: URL file-access is disabled in the server configuration in /nfs/c09/h02/mnt/137912/domains/fromaway.com/html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 1093

    Warning: copy(https://foursquare.com/img/categories/food/default.png) [function.copy]: failed to open stream: no suitable wrapper could be found in /nfs/c09/h02/mnt/137912/domains/fromaway.com/html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 1093

    Warning: copy() [function.copy]: URL file-access is disabled in the server configuration in /nfs/c09/h02/mnt/137912/domains/fromaway.com/html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 1093

    Warning: copy(https://foursquare.com/img/categories/food/pizza.png) [function.copy]: failed to open stream: no suitable wrapper could be found in /nfs/c09/h02/mnt/137912/domains/fromaway.com/html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 1093

    Warning: copy() [function.copy]: URL file-access is disabled in the server configuration in /nfs/c09/h02/mnt/137912/domains/fromaway.com/html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 1093

    Warning: copy(https://foursquare.com/img/categories/shops/furniture.png) [function.copy]: failed to open stream: no suitable wrapper could be found in /nfs/c09/h02/mnt/137912/domains/fromaway.com/html/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 1093

  • Anonymous

    Hi Malcolm.

    A couple of questions …
    1. Do you have a URL I can look at?
    2. Has it worked in the past and now started doing this or is this the first time you have used the plugin?

  • http://www.facebook.com/mbedell Malcolm Bedell

    Sure…I will activate it now in the footer on http://www.fromaway.com. This is the first time I have used the plugin.

  • Anonymous

    OK. Thanks Malcolm.
    It appears that the server you are on has disabled the copy function so after some quick googling I have changed the way the images are cached. Keep an eye out for v2.0.5 which I just uploaded to wordpress.org and should be available within 15 minutes (apparently it WordPress only update plugin every 15 minutes)

  • http://www.facebook.com/mbedell Malcolm Bedell

    Wow, you are amazing! Thank you so much! I will make a donation for sure!

  • Anonymous

    Thank you Malcolm. It is so nice to actually be appreciated :)

  • http://www.facebook.com/mbedell Malcolm Bedell

    I sent you a $20 spot…use it wisely. :) Thanks again.

  • http://twitter.com/metzkerei Chris Metzker

    thanks for the update, its great – doens’t show my private checkins anymore … perfect :) ))

  • Anonymous

    Your most welcome Chris. All donations greatly appreciated ;)

  • jinc415

    hi nzguru

    I’m getting the following error when trying to activate the plugin

    “The website encountered an error while retrieving http://www.mydomain.com/wp-admin/plugins.php?activate=true&plugin_status=all&paged=1. It may be down for maintenance or configured incorrectly.”

    Searched high and low but haven’t had any luck resolving – have v2.0.5 of the plugin and using WordPress 3.0.1

    Any help would be much appreciated!

  • Anonymous

    Hi jinc415,
    I’ve not come across that error either. What I would suggest though for a start is upgrade your WordPress to 3.0.3 (and I have just released 2.0.6 of the plugin) and then try again.

    Have you had any issues with other plugins?
    Is this an existing blog or new install?

  • Rayn

    nice work.
    But instead of the widget I would like to put in on my wordpress.org Page instead.
    i tried to use short codes(in html format):
    [foursquare_venues]checkinstype=checkinstimestamp=1

    but it didn’t work, what did i missed?

  • http://twitter.com/juliozuniga juliozuniga

    Hi. This plugin looks great but I’m having a problem. I cant make it work. I put API key and secret information and after all the cycle (including 4sq allowing) I return to wordpress, to the same settings page with the message Not connected to foursquare.
    I have this website in a Dreamhost server.
    Thanks in advance for your help.

  • http://twitter.com/dinorastoder Dino Rastoder

    When try to access http://localhost/example.com/wp-content/plugins/foursquareapi/FourSquareAPI.php I got errorFatal error: Class ‘WP_Widget’ not found in C:wampwwwexample.comwp-contentpluginsfoursquareapiFourSquareAPI.php on line 296WordPress 3.3.2Do you have any idea about this error? tnx

  • jinc415

    Hi nzguru,

    I eventually got around to upgrading wp to 3.3.2 and the plugin is almost working—tantalisingly close.

    I don’t seem to be getting any pins on the map, and also the address thing at the bottom (attached) appears to be stretched—is there anything I can do to fix this?

    Looking forward to getting this plugin going :)

  • http://www.fourjandals.com/ Cole @ Four Jandals

    Any chance you can let me know where you have got this running jinc415? Would love to get this set up on our own site. Cheers

  • http://www.fourjandals.com/ Cole @ Four Jandals

    Is there a way I can only make this display check-ins with a certain #hashtag or between a date range? Thanks!

  • http://twitter.com/leitmedium Caspar C. Mierau

    Hey,

    thanks for the great plugin. I noticed nonetheless that it increases my page load time from about about 300ms to 5000ms. I’s able to improve it a bit by chmod’ing the images dir, so cached images could be written there. But it stays around 5000ms still, so I had to disable it for know. Any hints for debugging/tweaking?

    Best,

    ccm.

  • http://twitter.com/EmBloger Василий Эмерик

    Good day. I have a problem. Installed the plugin and when connected to a 4SQ an error after you like I should confirm (see photo) Fatal error: Call to undefined function curl_init() in /var/www/ardel/data/www/blogema.com/wp-content/plugins/foursquareapi/FourSquareAPI.php on line 691

  • mvaahsen

    Hi, I connected everything and get no errors – but I don’t get my checkins displayed in the widget – any ideas?

  • mvaahsen

    The Badges-Widget is working fine ,,,

  • mvaahsen

    Sorry, forget what I said – everything ist working fine :)

  • http://www.mallorcasensation.com/ Alex Martinelli

    Hi, I own a website with WordPress 3.5.1 and the free template “Bestra” (select it from http://demo.magpress.com/). No way to make the widget display properly. It’s impossible to show the map and the scrollbox (or list, they behave the same) has the wrong dimensions. The widget width is 280px. Could you please help me to solve this problem? Thank you in advance.