|printf( "hello world!\n");
||[Dec. 10th, 2003|03:04 pm]
Hi everyone, |
I was invited to join this community because of a support query I made, and here I am. By day I code games for a living, so you could say I'm into graphical UI's for large database sets ;) Anyway here's what I'm working on:
I'm planning a silly meme thing, where you get a sorted bar chart of your LJ friends, showing their # journal entries, # comments posted, and # comments received. Here's the rub though, I can't get at that info about a user without parsing userinfo.bml in full mode for each member of someone's friends list.
I'm not going to do that. First it'd be extremely rude to lj.com sucking bandwidth like that for a pointless throw-away meme, and second it would crucify my own bandwidth.
I had a look through the XML-RPC console commands but I didn't see anything appropriate. I'm not sure how SET works, but if a userprop is what I think it is then I guess I'd be interested in the GET equivalent, where information like number of posts is just treated as a read-only userprop for these purposes.
Looking at my own friends list, those people average about 50 friends each. So taking that as a guide, and given spacefem's colour quiz stats [here] indicating a peak hitrate of about 900 per hour, that would be about twelve requests from me to download userinfo.bml per second! I dunno about you guys but my web host would start getting a bit stroppy about that.
So I have two options:
I could cache the results. Working on the Bacon Game / 5 degrees of separation theory, by the time most of the 300+ friend monster-users get involved, half their friends will already be in my database. I can seed the database at my own leisure before going live, by going three degrees into my own friends list. That should keep the initial spike down too.
I don't see this meme being particularly long-lived so a snapshot of the stats like this is fine, and if it does end up sticking around for a while then I could always add the option for a person to refresh their own friends stats and limit it to one refresh per day or something.
Or I could push for userinfo queries to become available in some limited lj.com-friendly variety via the XML-RPC console.
In fact I would prefer to do both, because 1800 requests per hour (one to get the friends list and then one to ask for their stats) is probably still going to nail my web host and get me into trouble :)
So, what do you guys think?