Skip to content

Instantly share code, notes, and snippets.

@atilacamurca
Created April 3, 2014 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atilacamurca/9961414 to your computer and use it in GitHub Desktop.
Save atilacamurca/9961414 to your computer and use it in GitHub Desktop.
Trecho referente a classe Zend_Service_SlideShare, houve mudanças na API e alguns nomes das tags do XML estão diferentes.
protected function _slideShowNodeToObject(SimpleXMLElement $node)
{
if($node->getName() == 'Slideshow') {
$ss = new Zend_Service_SlideShare_SlideShow();
$ss->setId((string)$node->ID);
$ss->setDescription((string)$node->Description);
$ss->setEmbedCode((string)$node->Embed); // changed
$ss->setNumViews((string)$node->Views);
$ss->setPermaLink((string)$node->URL); // changed
$ss->setStatus((string)$node->Status);
$ss->setStatusDescription((string)$node->StatusDescription);
foreach (explode(",", (string)$node->Tags) as $tag) {
if (!in_array($tag, $ss->getTags())) {
$ss->addTag($tag);
}
}
$ss->setThumbnailUrl((string)$node->ThumbnailURL); // changed
$ss->setTitle((string)$node->Title);
$ss->setLocation((string)$node->Location);
$ss->setTranscript((string)$node->Transcript);
return $ss;
}
require_once 'Zend/Service/SlideShare/Exception.php';
throw new Zend_Service_SlideShare_Exception(
'Was not provided the expected XML Node for processing'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment