I’m using PHP curl to obtain an XML string for parsing and I’d like to parse with XMLReader. I can’t find any good examples of how to iterate through each of the entries while storing some of the nodes (user, title, updated) as variables. Then I want to do something with the variables and move onto the next entry. I also need to be able to check if a node is empty (to be able to identify which entries have geo data).
An example xml feed would look like this.
Thanks.
Try using a PHP client built for Twitter, such as – http://code.google.com/p/twitter-php/
Then you don’t have to parse XML etc.
Using this library, your code for search page would look like
The search() method provides searching in twitter statuses:
The returned result is a PHP array: