As in my previous post, I briefly introduced how you can use SimpleXML object to load various web services’ API query urls, if you so choose to mashup a website with data provided by the various websites, such as YouTube and Amazon. Of course, the pay off comes when you use some affiliate code in your query, such as the famouse Amazon’s ECS and you did a pretty well job on your page layout & design, and seo to attract many visitors to you sites. (more…)
thank you very much for this article..
How to use SimpleXML parsing XML data with namespace and CDATA
There are many social network websites (e.g. YouTube) and big brand websites(e.g. Amazon, Yahoo) use REST or SOAP or even RSS web services to provide the enormous data for developers. Using these data, we can build a website virtually with no own database at all, all the information are come from these big sites. The nice thing is that, virtually all of the data returned for your web service client request are a XML data stream. So, we can use the nice PHP5 built in SimpleXML object to parsing the XML data stream, and format the representation of the data according our own website needs. However, the XML data format vary from site to site, some of the XML data returned from the sever, includes namespace and CDATA; if this is the case, you need find a way to access a sub item in the XML data use the same ” -> ” syntax. (more…)
What is the url you are using for getting the xml feed, currently I'm using 'http://gdata.youtube.com/feeds/base/videos/-/dance' for example as a ...
Are you sure the live feed you got is in correct format. Here is the code I run on the ...
even when doing it like the example above it gives me an empty string: $media = $item->children('http://search.yahoo.com/mrss/'); $videoDescription = $media->group->description; ...
To speed things up (since I only want the description),if I do an: $entry->children('http://search.yahoo.com/mrss/')->group->description; It should give me the contents of ...
Thanks! GREAT!


