…the wise rule the strong…

Activist Nerd

Archives Posts

SimpleHighrise, a PHP wrapper class for the Highrise API

August 14th, 2007 by garlinii

I have just began using some of the products from 37signals, including Ta-da List, Backpack, and Highrise (I also have a dormant Basecamp account).

Today I’d like to announce the first of many coding projects I’ll be posting at Activist Nerd: SimpleHighrise. This was inspired SimpleBackpack, the PHP wrapper class for Backpack, and much of the underlying utility code remains intact.

Download

SimpleHighrise.php, vAlpha

SimpleHighrise.php, vBeta

SimpleHighrise.php, vGamma

Disclaimer

This code comes no warranty, so use it at your own risk

What it doesn’t do [yet]

  • Error checking/handling
  • Update operations on objects listed in the Highrise API

What it does do

On all objects listed in the Highrise API:

  • Show
  • List
  • Create
  • Destroy

Please try it out and let me know any problems, issues, or ideas about SimpleHighrise!

Sample Usage

The following code instantiates a SimpleHighrise object. $result will hold the raw XML for all of the people the user can see:

include('simplehighrise.php');
$token = "token".":foo"; // tack on : (colon) and dummy password
$hr = new SimpleHighrise('user', $token);
$result = $hr->list_people();
echo $result;

Just as in SimpleBackpack, in order to return SimpleXML, do the following:

include('simplehighrise.php');
$token = "token".":foo";
$hr = new SimpleHighrise('username', $token, 'simplexml');

I’ll be adding to this as time progresses.

Update (24 Sep 2007): I posted vGamma, which has the following changes:

  • Error handling: returns -1 if no results are returned from an op or if an op fails
  • Better case support
  • Miscellaneous bug fixes in handling different data types

Update (16 Aug 2007): I posted vBeta, which has the following changes:

  • Added ability to return results as an array, using code from here. Here is an example:include('simplehighrise.php');
    $token = "token".":foo";
    $hr = new SimpleHighrise('username', $token, 'array');
  • Fixed search_people() and search_companies() to be able to return multiple people/companies (before, it was written to only return the1st person/company.
  • Miscellaneous bug fixes.
Filed under Code having 15 Comments »

Archives Posts

The Beginning…

August 13th, 2007 by garlinii

I’ve been wanting to start this site for a while. It always fascinates me how God has you do stuff only when it makes sense in the grand scheme. That can be a tough pill to swallow for the impatient.

The Activist Nerd is about me, Garlin Gilchrist II, part Nerd, part Activist, all Black man. I’ll share all three facets of my split-personality here, from code to campaigns to racial discourse. If those sound disconnected, you must not have met me yet.

Enjoy.

More here.

Filed under Activist Nerd having No Comments »