diff options
| author | moehm | 2014-05-30 11:06:50 +0200 |
|---|---|---|
| committer | moehm | 2014-05-30 11:06:50 +0200 |
| commit | b8555c234a6c797b5dd408ac5d9fe5ba17e00373 (patch) | |
| tree | e6986b0a9de981f60793e36e93860f75180ae9cc | |
| parent | d6997febbdf6d424fcd0702e3324588387dc2cd9 (diff) | |
| parent | 7c8f6345ef35b6fca9283b5e1c23d22cf9466294 (diff) | |
| download | random-master.tar.gz | |
| -rw-r--r-- | www/Gununu_all.swf | bin | 0 -> 9882636 bytes | |||
| -rw-r--r-- | www/functions/func_yt.php | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/www/Gununu_all.swf b/www/Gununu_all.swf Binary files differnew file mode 100644 index 0000000..bfeaa75 --- /dev/null +++ b/www/Gununu_all.swf diff --git a/www/functions/func_yt.php b/www/functions/func_yt.php new file mode 100644 index 0000000..4aa1e29 --- /dev/null +++ b/www/functions/func_yt.php @@ -0,0 +1,26 @@ +<?php + +function get_yt_data($id){ + $data = file_get_contents("https://gdata.youtube.com/feeds/api/videos/".$id.""); + $data = preg_replace("/yt:statistics/", "ytstatistics", $data); + $data = preg_replace("/media:group/", "mediagroup", $data); + $data = preg_replace("/media:description/", "mediadescription", $data); + $data = preg_replace("/gd:rating/", "gdrating", $data); + $xmldata = simplexml_load_string($data); + + $title = $xmldata->title[0]; + $viewCount = $xmldata->ytstatistics["viewCount"]; + $author = $xmldata->author->name[0]; + $desc = $xmldata->mediagroup->mediadescription[0]; + $date = $xmldata->published[0]; + $rate = $xmldata->gdrating["average"]; + + $res["title"] = $title; + $res["viewCount"] = $viewCount; + $res["author"] = $author; + $res["desc"] = $desc; + $res["date"] = $date; + $res["rate"] = $rate; + + return $res; +} |
