Feb
17th

WordPress: Seesmic Plugin

Thanks for stopping by my personal blog on Marketing Technology! Over 50,000 visitors a month find my content worth returning for, so don't forget to subscribe to the Marketing Technology Blog RSS feed or to the Marketing Technology Email to have new content sent directly to your inbox. You may also find my other business blog helpful, Social Media Domination.

This was a fun project! With the API for Seesmic launching, I was chomping at the bit to post my videos on my blog so folks could see more videos from me. Utilizing the same architecture as some of the other WordPress plugins I’ve built, I built out a Seesmic WordPress plugin.

This plugin was different because it required me to decode JSON and work quite a bit more with multi-dimensional arrays and PHP. Sorry if that sounds like greek to you… here’s some explanation.

What’s an API?

When you type a URL into your browser’s address bar, what actually occurs is that you make a request to the server you’re trying to reach and then that server serves up the HTML and images to make the page. An API does the same thing - only the page you’re on (AJAX) or the server that your page is served from makes the request.

Instead of serving HTML and images, though, the API serves back XML, or eXtensible Markup Language or most recently, JSON. Simply put - where HTML is made to be viewed by a human, XML and JSON are designed to be consumed by a computer. It’s a strict construction of data that is returned.

APIs are useful because you can integrate your applications into others. If you build a new application out of an API, that’s typically known as a Mashup.

New technologies require new platforms

PHP5 enhanced PHP’s abilities to consume XML and JSON (SOAP-based Web Services are next!). Trying to parse XML and JSON without PHP5 on a Linux host was cumbersome and took a lot of code and resources. I would never recommend it.

I wrote this plugin using the json_decode method within PHP5.2+ since the Seesmic API’s first evolution is JSON. This function simply takes the JSON returned and throws it into an array or multi-dimensional array that can be parsed just as any array can. Arrays can be complex (it drove me nuts this afternoon), but once you understand the structure, they’re very easy to use.

WordPress Admin for Seesmic Plugin

You might also find these posts interesting:

RSS feed | Trackback URI

13 Comments »

Comment by no imagelaza (SezWho)
2008-02-17 05:14:03

Awesome Douglas! :D
Rate this:
1.6
Comment by no imageDouglas Karr (SezWho)
2008-02-17 12:29:26

Thanks, laza!
Rate this:
2.9
 
 
Comment by no imagecisco (SezWho)
2008-02-17 12:26:10

i try your plugin, but when i activate the plugin, i have this error message :

Parse error: syntax error, unexpected ‘{’ in /home.32/c/i/s/ciscosho/www/wp-content/plugins/wpseesmic/wpseesmic.php on line 65

can you help to resolve this problem

thanks

cisco

Rate this:
3.0
Comment by no imageDouglas Karr (SezWho)
2008-02-17 12:34:53

Hi Cisco,

The requirements call for PHP 5.2+. This version is necessary because it has built in JSON decoding, which is required for the Seesmic API. You’re probably running PHP4… check with your hosting company to get upgraded.

If you’d like to check what version you’re running, make a blank php file on your site and put:
<?php phpinfo(); >

It will display what version you are running as well as whether cURL is enabled.

Doug

Rate this:
2.9
 
 
Comment by no imageDouglas Karr (SezWho)
2008-02-17 12:28:32

For some reason, the API didn’t appear to respond with a session id the first time. I’ve added a loop to make up to 3 attempts for the session id. It seems to be doing the trick on my blog.
Rate this:
2.9
 
Comment by no imagejay dedman (SezWho)
2008-02-17 15:43:58

maybe i missed it. Is there a link to an example post that has these seesmic comments embedded? im a little confused how they would look and feel on the page.
Rate this:
1.6
Comment by no imageDouglas Karr (SezWho)
2008-02-17 22:18:12

Jay,

I’ve not added it as a posting mechanism yet, but it’s on the list! Just a note to everyone - I just pushed version 1.0.2 which now has a link to the original video if your video was a reply.

Cheers,
Doug

Rate this:
2.9
 
 
Comment by no imagecisco (SezWho)
2008-02-18 08:24:18

Awesome Douglas, i succeed to go under Php 5 easily, now i have your plugin on my blog… thanks
Rate this:
3.0
Comment by no imageDouglas Karr (SezWho)
2008-02-18 12:29:33

Looks great, Cisco!
Rate this:
2.9
 
 
2008-02-26 16:27:56

[...] French, David would like this. I will have to give it a shot. Thankfully Douglas Karr has created a seesmic plugin for Wordpress. Now there is a face to the [...]
 
Comment by no imageAndrea Vascellari (SezWho)
2008-03-27 09:17:16

Hi Douglas!

Love the concept behind this plugin but I have some difficulties in using it.
Do you have any idea why I get this http://tinyurl.com/27zrw9
Once activated, what I get in the options menu is what you see in the screenshot

Andrea

Rate this:
2.9
 
Comment by no imageAndrea Vascellari (SezWho)
2008-04-04 03:35:33

I tried to install the plugin on another blog (that should use a different php version) but I couldn’t activate it. Here’s the screen shot

http://www.flickr.com/photos/vascellari/2387250996/sizes/o/

Now I’m going to send you a video on seesmic too.

Andrea

Rate this:
2.9
Comment by no imageDouglas Karr (SezWho)
2008-04-04 10:50:15

Andrea,

The plugin requires PHP 5.2+ and cURL enabled. cURL is usually enabled by default and won’t cause this issue.

Doug

Rate this:
2.9
 
 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

My Comment Policy: I moderate comments. Please be patient:

  • Spam will happily be destroyed.
  • Use your real name, not some keywords. Otherwise it will be destroyed.
  • Mean comments aren't necessary. If I don't post them I will reply personally to let you know why.
  • Lewd comments will be edited, I don't want my readers leaving because of offensive content.
Great debate, criticism and colorful commentary is always appreciated and approved!