WordPress Plugin for Joind.In
Plugin Features
At the moment the plugin can display one of two data sets: The hot events on joind.in; or the talks from an event on joind.in. You can change the title on the block, limit the maximum number of records returned, specify which event the talks should come from and also indicate if you’d like the order randomised. You can see the plugin in action on techPortal, where it is picking a few sessions at this year’s Dutch PHP Conference to tempt you with!
Technical Information
I hadn’t written a wordpress plugin before although I was very familiar with the joind.in API and how to work with it from PHP. The plugin was relatively easy to write, there are plenty of tutorials on the web and I didn’t need to do anything particularly clever. I looked at a twitter plugin, tweetblend, which was a similar sort of idea in that it had settings, talked over an API, and stored data, and used that when I got stuck. My plugin is much simpler but that’s OK (and probably makes it a good example for me next time I want to write one of these things!!)
The plugin creates a database table when it is activated (and drops it when deactivated) which caches the data pulled from joind.in for a few minutes. This helps avoid lots of users having to wait for the data to load and also hopefully stops the plugin from pushing too much load to the joind.in servers. Since there is no limit or pagination on the joind.in API, even though only a few records are shown the whole result is cached. This means that if you turn on the randomise then the cache is still useful! The “random” is a bit contrived in that it just picks elements out of the array that haven’t been used but it looks fine to me.
Initially I was just going to put something together and upload it to the techportal site but I was persuaded that it would be a useful thing to share – so there it is. Comments and suggestions are all welcome – and if you are using it to publicise your event, let me know!
Looks good Lorna!
WordPress plugins are pretty simple to write aren’t they?
A few things worth mentioning:
1. I would suggest using the WordPress HTTP API instead of curl directly. Doing this means that your plugin will also work for people without curl installed. A good tutorial is here: http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/
2. It’s probably worth mentioning in the readme file that the plugin requires PHP5+. It will help prevent support requests from PHP4 users wondering why the plugin doesn’t work.
James
James: What an outrageously helpful set of comments, thanks very much! I will certainly make the changes you mention – thanks very much for dropping by :)
James: I did indeed update my plugin to use the wordpress HTTP API, and also to fix quite a nasty bug in it. All shiny and working at version 1.2. Thanks again for your input
No worries Lorna, and thanks for the mention in the changelog!
Hi all, Plugins can extend WordPress to do almost anything you can imagine.NextGEN Gallery is a full integrated Image Gallery plugin for WordPress with a Flash slideshow option. Version 1.5.3, I am using that kind of Plugin.
Last weekend I was at WorkCampUK in Manchester – it’s taken me this long to writ the blog post because I needed time to download my photos, however I’ve now done that and I didn’t get anything at all worth publishing, d’oh! I am a wordpress user and ev
Awesome, I was thinking today of listing my own talks on my WordPress blog using the Joind.in api directly. Is this something your plugin could do? Or should I add some features to make it do just that?
We should start a new plugin – this one is really old and talked to the old API which will be going offline in the coming months. Docs for the API are here http://joindin.github.io/joindin-api/ and you should talk to us in #joind.in and tell us how we can help you make this happen!