diff options
author | Sem <sembrestels@riseup.net> | 2011-12-31 21:04:45 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-12-31 21:04:45 +0100 |
commit | 789c5d12f23d3158c65c8654c9dcf7bd0a67b9a4 (patch) | |
tree | 780238212523be03dee60c16202fb52201e6b10b /lib | |
parent | 9a449b126c89481baadb8810d2d304c93aded7a8 (diff) | |
download | elgg-789c5d12f23d3158c65c8654c9dcf7bd0a67b9a4.tar.gz elgg-789c5d12f23d3158c65c8654c9dcf7bd0a67b9a4.tar.bz2 |
Readded giss.tv support.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gisstv.php | 41 | ||||
-rw-r--r-- | lib/videolist.php | 2 |
2 files changed, 42 insertions, 1 deletions
diff --git a/lib/gisstv.php b/lib/gisstv.php new file mode 100644 index 000000000..24e11340a --- /dev/null +++ b/lib/gisstv.php @@ -0,0 +1,41 @@ +<?php + +function videolist_parseurl_gisstv($url) { + $parsed = parse_url($url); + $path = explode('/', $parsed['path']); + + if ($parsed['host'] != 'giss.tv' || $path[1] != 'dmmdb') { + return false; + } + + if($path[2] == 'contents' && isset($path[3])) { + $video_id = $path[3]; + } elseif($path[3] == 'contents' && isset($path[4])) { + $video_id = $path[4]; + } else { + return false; + } + + return array( + 'videotype' => 'gisstv', + 'video_id' => $video_id, + ); +} + +function videolist_get_data_gisstv($parsed){ + $video_id = $parsed['video_id']; + + $buffer = file_get_contents('http://giss.tv/dmmdb//rss.php'); + $xml = new SimpleXMLElement($buffer); + + $data = array(); + foreach($xml->xpath('/rss/channel/item') as $item){ + if(sanitize_string($item->link) == 'http://giss.tv/dmmdb//contents/'.$video_id) { + $data['title'] = sanitize_string($item->title); + $data['description'] = strip_tags($item->description); + $data['thumbnail'] = sanitize_string($item->thumbnail); + break; + } + } + return $data; +} diff --git a/lib/videolist.php b/lib/videolist.php index 4e12c5361..45253a9e3 100644 --- a/lib/videolist.php +++ b/lib/videolist.php @@ -1,6 +1,6 @@ <?php -define('VIDEOLIST_SUPPORTED_PLATFORMS', 'youtube, vimeo, metacafe, bliptv'); +define('VIDEOLIST_SUPPORTED_PLATFORMS', 'youtube, vimeo, metacafe, bliptv', 'gisstv'); foreach(explode(', ', VIDEOLIST_SUPPORTED_PLATFORMS) as $videotype){ include(elgg_get_plugins_path()."videolist/lib/$videotype.php"); |