I went ahead and wrote an XML-RPC client to process friends only journals, as well as handle requests for full journal distributions. For all of you who requested this, enjoy :)
require_once("XML/RPC.php"); class LJ_Client { var $if = null; var $user = null; var $password = null; function LJ_Client($user=null, $password=null, $proxy_host=null, $proxy_port=null, $proxy_user=null, $proxy_password=null) { $this->user = $user; $this->password = $password; $this->if = new XML_RPC_Client('/interface/xmlrpc', 'www.livejournal.com', 80, $proxy_host, $proxy_port, $proxy_user, $proxy_password); } function getEvents($n = 50, $before = null) { if($before == null) { $before = date("Y-m-d H:i:s"); } $msg = new XML_RPC_Message('LJ.XMLRPC.getevents', array(XML_RPC_encode(array('username' => $this->user, 'hpassword' => md5($this->password), 'selecttype' => 'lastn', 'howmany' => $n, 'ver' => 1, 'beforedate' => $before)))); $resp = $this->if->send($msg); if (!$resp) { echo 'Communication error: ' . $this->if->errstr; exit; } if (!$resp->faultCode()) { $val = $resp->value(); $data = XML_RPC_decode($val); return $data['events']; } else { /* * Display problems that have been gracefully cought and * reported by the xmlrpc.php script */ echo '<b style="color:#f00;">'; echo 'Fault Code: ' . $resp->faultCode() . "\n"; echo 'Fault Reason: ' . $resp->faultString() . "\n"; echo '</b>'; } } } $user = $_REQUEST['user']; $pass = $_REQUEST['password']; $c = new LJ_Client($user, $pass); $events = $c->getEvents(50); while($o = end($events)) { $ldate = $o['eventtime']; $r = $c->getEvents(50, $ldate); if(sizeof($r) == 0) { break; } else { $events = array_merge($events, $r); } } $h_dist = array(); foreach ($events as $e) { $h = (int)current(split(':', end(split(' ', $e['eventtime'])))); $h_dist[$h]++; }
12am | 1am | 2am | 3am | 4am | 5am | 6am | 7am | 8am | 9am | 10am | 11am |
12pm | 1pm | 2pm | 3pm | 4pm | 5pm | 6pm | 7pm | 8pm | 9pm | 10pm | 11pm |
[/update]
Originally hacked togther last night in a fit of boredom. Seems to have caught on with the friends page. Try it, but I'm running the server locally, so if it gets too slow/dies, sorry :(
N.B.: Also only works on the last 25 entries, so not a large enough sample to make any cooler observations on. If anyone could chim in with a practical method for retrieving older entries (page-scraping and XML-RPC w/ authentication aside), it would be much appreciated :)
12am | 1am | 2am | 3am | 4am | 5am | 6am | 7am | 8am | 9am | 10am | 11am |
12pm | 1pm | 2pm | 3pm | 4pm | 5pm | 6pm | 7pm | 8pm | 9pm | 10pm | 11pm |
[edit: Updated 07:15 2005/05/20 - Text color problems should be fixed now, as well as a few other minor issues.]
← Ctrl ← Alt
Ctrl → Alt →
← Ctrl ← Alt
Ctrl → Alt →