arappingshrimp wrote in php

I'm working on a meme for livejournal and, as many of them do, it'll be incorporating friends-data.
I've coded in many other languages but little in PHP so I have a few questions.....




  • Which would be the best functions to use to retrieve a user's "friends data"? Right now I'm using file_get_contents like so:



    file_get_contents("http://www.livejournal.com/misc/fdata.bml?user=$ljuser");



    it works, of course, but is there anything I should be aware of? Each language has so many...quirks..that it's good to ask....



  • Can I change the User-Agent while using the above function? and if so, how? (...so that I comply with LJ's bot policy). It's so much less hassle than fsockopen....



  • Which would be a better idea: storing each user's "friends data" in a separate file, or storing them all in an SQL database? The first way is obviously easier, and eats less CPU, but my host might not appreciate it because it means, potentially, thousands of little files. (and besides I'm really not looking forward to learning SQL...)