Postcards From My Life

Lint I find in my mind's belly-button.
  • EPK
  • Consulting
  • Resume
  • Nerd Herding
  • Talks
  • How to Plan a Website
  • Zend Framework
« Six ways to be a better client for your developer – Point 7 (The secret hidden bonus track)
…of influence and klout »

PHP Wrapper for Klout API

Dear Reader,

Klout PoweredIn a previous tweet about playing with Klout and Twitter I talked about a project I am working on that mines Klout for interesting people. (Well, interesting to me) The main body of code remains procedural because…well because it works and it’s not something I’m going to share so why bother cleaning it up. However parts of it may be useful to me in other projects. So I abstracted the Klout API into a class and have posted it for anyone who wants to use it.

Klout API Wrapper for PHP

Since this is my first GitHub repository, there is a pretty good chance I botched it. :) I’m hoping that if I did, one of you will be kind enough to point out how to do it correctly, and not that I just botched it.

The code itself is unremarkable. If you’ve ever written a wrapper for an API, they all work basically the same way. In this case, I ignored the concept of “Separation of Concern” in that I left the code that makes the call enclosed in the object. It’s on my todo list to split this off into it’s own class and possibly make a couple of different “transports”, mainly for example sake as they will all do basically the same thing, just use different PHP functions to do it. Then I would pass in a “Transport” into _execute() in what I believe is an implementation of the Visitor pattern. As I said, it would be largely educational for me because as is, the code works just fine. (and really, that’s the most important part.)

So, if you’ve ever wanted to play with Klout’s API (it’s VERY simple but I find the info it gives me very interesting.) I hope this little piece of code fluff makes it easier for you.

Until next time,
I <3 |<
=C=

Buffer

Tags: API, github, klout, PHP

This entry was posted on Monday, January 31st, 2011 at 5:00 am and is filed under PHP, Programming. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Logging In...

Comments are closed.

  • 5 Replies
  • 4 Comments
  • 0 Tweets
  • 0 Facebook
  • 1 Pingback
Last reply was February 22, 2011
  1. Alister
    View January 31, 2011

    Well timed, Cal.

    Tomorrow, I start working for another company in the same space – http://peerindex.net. I’ll have to see what I can do to put up some PHP/API code up to also fetch from the platform as I learn more about that myself – though right now, PI just returns a single metric. I’m sure that will change though as time goes on.

    Alister

  2. Tweets that mention PHP Wrapper for Klout API | Postcards From My Life -- Topsy.com
    View January 31, 2011

    [...] This post was mentioned on Twitter by Cal Evans, Josh Holmes. Josh Holmes said: .@calevans posted PHP Wrapper for Klout API: Dear Reader, In a previous tweet about playing with Klout and Twitt… http://bit.ly/fRAbeQ [...]

  3. Cal Evans
    View January 31, 2011

    @alister!

    Thanks for stopping by.

    I played with PI last week, it looks pretty cool. I’d love an API to get to the topics. If you guys develop that, let me know, I want to play with it.

    =C=

  4. Bob Giford
    View February 16, 2011

    Found this blog looking for a PI wrapper or widget of some sort. I think both Klout and Peerindex have the potential to be essential (qwerly is good too).

    Klout & Qwerly offer an embedded link with scores/details. Twitalyzer also has a mini-profile link that can be used in an iframe. PI offers nothing so you would have to visit frequently to check on your score and stats. LAME.

  5. Alister
    View February 22, 2011

    Bob, in PeerIndex’s defence (full disclosure: I work at @peerindex) it’s a fast moving target around here, and both PI and Klout are still building our respective technologies. PI does have a basic API, and it’s already being used in a number of pieces of software – like twitalyzer.com, hvr.me and DataSift.net.

    I know that it’s far from complete, and one of the things we’ll be doing in our Copious Free Time is extending it – to add such things as topics for users, and more generally, which Cal has already commented on. It’s on the roadmap, and a lot more will get added to the information. For now, we are starting to add that onto the website. I would love to do a JS widget as well, but I think its better to let the underlying processes settle down a little first.

  • Friends of mine

  • My Latest Book


    Avoiding a Goat Rodeo

  • Follow me on twitter!

  • RSS PHP Podcasts

    • Episode 7: Web Sockets Are Fast
    • Better Documentation for PHP internals – Lately in PHP podcast episode 35
    • Episode 31: Feline Tooth Extraction
    • Episode #2 – Adam Culp
    • Episode 6: PSR-X and the Mexican Standoff
    • Episode 109: Typescript and a bit more…
    • A Better PHP Feature Voting Process – Lately in PHP podcast episode 34
    • Episode 30: It’s Episode 30, you guys
    • PHP Innovation Award Winner of 2012 – Lately in PHP podcast episode 33
    • Episode 29: Snappy Answers to Stupid Questions

  • Me, elsewhere on the Web

    • Best web design company
    • Cal Evans Dot Com
    • Cyrano’s Apprentice
    • Evans Internet Construction Company
    • My Life as a Child
    • PHP Podcasts

  • Categories

    • Apache
    • BlogBling
    • Blogging
    • Book Review
    • codeworks
    • Entertainment
    • Entrepreneurship
    • Flex
    • Humor
    • JavaScript
    • Long Form
    • Management
    • Marketing
    • Me, elsewhere on the Web
    • PHP
    • podcasting
    • Programming
    • SQL
    • Technology
    • Web 2.0
    • wordpress
    • WordPress Plugins
    • writing
    • zend framework


Postcards From My Life is proudly powered by WordPress
Entries (RSS) and Comments (RSS).