Made of Everything You're Not

No, not the flute playing Eric Lamb; the guitar playing, PHP programmer Eric Lamb. The better Eric Lamb.
  • Home
  • Projects
  • Portfolio
  • Resume
« A Closer Look At Avactis
Create Expression Engine Plugin »

hResume hKit Profile

While working on Wp-hResume (a neat plugin for adding any hResume encoded resume to a WordPress site) I needed to make a decision. The strategy I was working on hinged on the choice between either using brute force regular expressions to parse the profile page for a single site (like the competition)  or to write the missing hResume profile for the hKit Microformat Framework.

hKit hResume

hKit hResume

The way I saw it, with regular expressions I could only build a plugin that would only work with a single site; whereas with an hKit profile the plugin could, in theory, work with any hResume encoded site. So, clearly, an hKit profile was the best option.

The only problem was that there isn’t any documentation on how to actually create a profile for hKit. I don’t want to go into detail on it, and to be honest I don’t really remember all the details so suffice it to say that brute forcing this thing sucked. Donkey balls. It took forever and the steps needed to build a profile used a methodology I wasn’t familiar with. But, after a long night of tequila I did end up putting it all together though and it works pretty nicely.

First though, here’s how hKit works for pulling in a microformatted URL:

<?php 
include('hkit.class.php');
$hKit = new hKit;
$result = $hKit->getByURL('hcard', 'http://microformats.org/');
?>

Pretty obvious stuff; give it a URL, set the type of encoding expected (this time it’s hcard) and it gives back an array with all the goodies.

To work with the new profile you have to place the profile file in the same directory as hkit.class.php. You can download the profile along with the latest version of hKit here.

The concept is the same with the new profile:

<?php
include('hkit.class.php');
$h = new hKit;	
$url = 'http://www.linkedin.com/in/mithra62';
$h->tidy_mode = 'proxy'; // 'proxy', 'exec', 'php' or 'none'
$result = $h->getByURL('hresume', $url);
print_r($result, 1);
?>

The above will pull my hResume encoded info from my LinkedIn profile. Same as the original hcard example. Easy like your sister.

Now go forth and start parsing hresume encoded URLs :)

Bookmark and Share

Related Posts

Stand Alone ExpressionEngine Authentication
Importing Legacy Users Into ExpressionEngine
CartThrob 2.0 Beta Fun
ExpressionEngine and the Mystery of M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr
Custom Routes With Zend Framework

Tags: career, hresume, php

This entry was written by Eric Lamb and posted on Wednesday, June 2nd, 2010 at 5:14 pm and is filed under Code, Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Comments

  1. Drew McLellan says:
    June 30, 2010 at 5:10 am

    Thanks for toughing it out and creating a profile for hResume. Sorry it was such hard work!

    Reply
    • Eric Lamb says:
      June 30, 2010 at 10:38 am

      Hi Drew,

      I’m sure things were more complicated from the drinking than the process :)

      Eric

      Reply
  2. Mark says:
    June 30, 2010 at 8:04 am

    Have you thought about putting the code on github?

    Reply
    • Eric Lamb says:
      June 30, 2010 at 10:39 am

      Honestly, not until I read your comment. I’ll look into it :)

      Eric

      Reply
  3. Tom says:
    July 13, 2010 at 5:44 pm

    I see it display the description copy three times all in a row for each experience node. Also, and maybe this is LinkedIn’s fault, but descriptions have random spaces stripped out. Any thoughts as to what’s causing either of these behaviors?

    Reply
  4. Sharron Clemons says:
    December 21, 2010 at 12:21 pm

    Hi Drew, I’m sure things were more complicated from the drinking than the process :) Eric

    Reply

Leave a Reply

Click here to cancel reply.

  • Subscribe: Entries | Comments
  • About Me

    Email Email
    Twitter Twitter
    310.739.3322
  • Categories

    • Brain Dump
    • Business
    • Code
    • IT
    • Programming
    • Rant
    • Servers
  • Archives

    • February 2012
    • October 2011
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008

Copyright © 2008 - 2012 Eric Lamb - All rights reserved