From f399afdd2e3cc072efaca069b7a874c7801b31f6 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Mon, 9 Apr 2012 17:05:57 -0400 Subject: switched to platform classes. see https://github.com/Elgg/videolist/issues/4 --- lib/Videolist/Platform/Metacafe.php | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lib/Videolist/Platform/Metacafe.php (limited to 'lib/Videolist/Platform/Metacafe.php') diff --git a/lib/Videolist/Platform/Metacafe.php b/lib/Videolist/Platform/Metacafe.php new file mode 100644 index 000000000..3cf2fb8ce --- /dev/null +++ b/lib/Videolist/Platform/Metacafe.php @@ -0,0 +1,39 @@ + 'metacafe', + 'video_id' => $path[2], + ); + } + + public function getData($parsed) + { + $video_id = $parsed['video_id']; + + $buffer = file_get_contents("http://www.metacafe.com/api/item/$video_id"); + $xml = new SimpleXMLElement($buffer); + + return array( + 'title' => current($xml->xpath('/rss/channel/item/title')), + 'description' => strip_tags(current($xml->xpath('/rss/channel/item/description'))), + 'thumbnail' => current($xml->xpath('/rss/channel/item/media:thumbnail/@url')), + 'embedurl' => current($xml->xpath('/rss/channel/item/media:content/@url')), + ); + } +} -- cgit v1.2.3