You are here:  » Vimeo Advanced API and XML Magic Parser


Vimeo Advanced API and XML Magic Parser

Submitted by crusnac on Wed, 2013-02-27 17:51 in

I am trying to integrate the MagicParser XML library with the Vimeo Advanced API. I got the Vimeo API to save a local copy of the XML output, but for some reason, when I try to pass the XML file to magic parser, if doesn't process anything.

See my code at:

http://pastebin.com/Kv3E5ajh

See the VIMEO Advanced php included at the top.

https://github.com/vimeo/vimeo-php-lib/blob/master/vimeo.php

Submitted by support on Thu, 2013-02-28 08:30

Hi,

It would be useful to see the first few bytes of the response that is being passed to MagicParser_parse via the string:// operator. One way to debug XML easily is to output into a textarea.

In your script, where you currently have this code:

$videos = $vimeo->call('vimeo.videos.getAll', array('format' => 'xml', 'full_response' => '1','summary_response' => '1'));

...REPLACE with:

$videos = $vimeo->call('vimeo.videos.getAll', array('format' => 'xml', 'full_response' => '1','summary_response' => '1'));
print "<textarea cols='80' rows='10'>".print substr(htmlspecialchars($videos),0,500)."</textarea>";

That will print the first 500 characters of your XML response. If it looks like valid XML and doesn't, for example, reveal a textual error message instead that indicates the problem, if you could copy the XML into a reply I'll check it out for you...

Cheers,
David
--
MagicParser.com