diff options
| -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; +} |
