Hey guys,
Ive written a script that will query the Twitter search API for a given query entered by means of a form and then having been looking for ways to chomp this xml into a list of usernames, found this page.
Gzipp's answer seems like a good option for me. I dont think there are any usernames that contain parentheses but the main reason is that I understand it .. apart from .. how to hook it into my script. My ultimate goal is to crunch the list of usernames returned into a plain text file for onward processing by a further script that will follow the returned users for a given account.
Im new to the site and have read as many faq as I could find so i hope im not breaking any rules or protocols in making this request on an old thread.. I guess what Im looking for are some of the meat and potatoes that would go around the snippit:-
=============================================
$names = 'username (Friendly Name)';
list($username, $friendlyName) = explode('(', $names);
$username = trim($username);
$friendlyName = trim($friendlyName, ')');
================================================
in order to be able to parse the usernames off into a file...
Im new to PHP, learning as I go, but sometimes I hit a brick wall...
TIA,
Wheen
PS I guess what I am asking is "how does pascal get the $names variable to contain whats in the atom?