Social Graph api client in diso repository

0 views
Skip to first unread message

Steve Ivy

unread,
Feb 2, 2008, 10:48:29 PM2/2/08
to diso-project, brad...@google.com, tan...@tantek.com, social-networ...@googlegroups.com
Hi all,

As you know, Google just released their social graph API
(http://code.google.com/apis/socialgraph/). I wrote a quick and dirty
client in PHP that cosumes the JSON and returns it in a data
structure. There's more work to be done, particularly in making the
fetch code work with either fopen or curl.

$sga = new SocialGraphApi(Array('edgesout'=>0,'edgesin'=>0,'followme'=>'1',
'sgn'=>0));

$mydata = $sga->get('http://redmonk.net');

echo "<pre>" . print_r($mydata,true) . "</pre>";

Find the code at:

http://diso.googlecode.com/svn/php/sgapi/

--
Steve Ivy
http://redmonk.net // http://diso-project.org
This email is: [ ] bloggable [x] ask first [ ] private

Stephane Daury

unread,
Feb 3, 2008, 10:06:18 AM2/3/08
to diso-p...@googlegroups.com

Steve, you are so da man!

re: curl vs. fopen: the following has worked well for me so far.
<http://labs.tekartist.org/parseme/svn/trunk/index.php>
lines 409 -> 438: if(function_exists('curl_init')) ...

I would have submitted a patch with a variant of the above, but
starting to *get the character*, you're probably way ahead of me in
your uncommitted checkout. ;)

---
Stephane Daury - http://tekartist.org/

Stephen Paul Weber

unread,
Feb 3, 2008, 10:07:41 AM2/3/08
to diso-p...@googlegroups.com
So cool! Definately going to be playing with this.

--
- Stephen Paul Weber, Amateur Writer
<http://www.awriterz.org>

MSN/GTalk/Jabber: singp...@gmail.com
ICQ/AIM: 103332966
BLOG: http://singpolyma.net/

Stephane Daury

unread,
Feb 3, 2008, 10:16:34 AM2/3/08
to diso-p...@googlegroups.com

Oh, quick question: has the group decided on php4 vs. php5, since
we're dealing with WP?

I've had to write a to_json function in the past, I could prob' crank
a from_json function if needed.

Stephane

Simon Wistow

unread,
Feb 3, 2008, 10:45:08 AM2/3/08
to diso-p...@googlegroups.com, brad...@google.com, tan...@tantek.com, social-networ...@googlegroups.com
On Sat, Feb 02, 2008 at 08:48:29PM -0700, Steve Ivy said:
> As you know, Google just released their social graph API
> (http://code.google.com/apis/socialgraph/). I wrote a quick and dirty
> client in PHP that cosumes the JSON and returns it in a data
> structure. There's more work to be done, particularly in making the
> fetch code work with either fopen or curl.

For what it's worth I just uploaded a Perl version of the API to CPAN.

It's almost exactly the same as the PHP one because, well, why not.


chris....@gmail.com

unread,
Feb 3, 2008, 12:35:24 PM2/3/08
to diso-p...@googlegroups.com
Pretty much PHP5, due to the use of tools like hKit and our need for
advanced XML processing. PHP5 isn't everywhere yet, but by the time we
get to a 1.0, hopefully it'll be available enough.
Chris


--
Chris Messina
Citizen-Participant &
Open Source Advocate-at-Large
Work: http://citizenagency.com
Blog: http://factoryjoe.com/blog
Cell: 412.225.1051
IM: factoryjoe
This email is: [ ] bloggable [X] ask first [ ] private

Steve Ivy

unread,
Feb 3, 2008, 12:39:59 PM2/3/08
to diso-p...@googlegroups.com
Is the JSON lib I've included 5-only?

Stephane Daury

unread,
Feb 3, 2008, 1:32:01 PM2/3/08
to diso-p...@googlegroups.com

I thought so for a second, but it was my bad. I looked up some php
docs refs and it look like it actually is backward compatible.

Can't wait for 2008-08-08... :p

Stephane

Reply all
Reply to author
Forward
0 new messages