Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Sun Feb 25, 2018 9:31 pm Reply with quote

module RN_Video is not working anymore.

P.S YouTube API implementation with SimpleXML no longer working

Code:
Warning: simplexml_load_file(http://gdata.youtube.com/feeds/api/videos?v=2author=bestbuildpc&start-index=1&max-results=25): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /modules/RN_Video/classes/Php5tube.php on line 168


Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/videos?v=2author=bestbuildpc&start-index=1&max-results=25" in /modules/RN_Video/classes/Php5tube.php on line 168

Warning: Invalid argument supplied for foreach() in /web/htdocs/www.bestbuildpc.org/home/modules/RN_Video/classes/Php5tube.php on line 179


Code:
   function getUserVideos($user,$category=null,$start_index =1,$max = 25){

      //set up the url to the feed
      $feedURL = 'http://gdata.youtube.com/feeds/api/videos?v=2author='.$user.'&start-index='.$start_index.'&max-results='.$max;
      
      //add category variable to feed url, if it exists
      if($category != null){ $feedURL = $feedURL . '&category=' . $category; }
      
      //read the feed and place it in an simple_xml object
      $xml = simplexml_load_file($feedURL);
      //get the next start index.
      if(!empty($xml->link[4])){
         $this->next_index = (int)preg_replace('/&max-results='.$max.'/', '', preg_replace('/http:\/\/gdata.youtube.com\/feeds\/api\/videos\?author='.$user.'&start-index=/','', (string)$xml->link[4]->attributes()->href));
      } //if empty, then set $this->nex_index to -1 to let the user know they have reached the end of the list
      else {
         $this->next_index = -1;
      }
      
      $video_array = array (); //holds the video objects
      $i = 0;
      foreach ($xml->entry as $entry) {
         //id is the full url to get the video feed.  the characters after the last slash is the actual video id
         //so id here could be 'http://gdata.youtube.com/feeds/api/videos/2jkExrrm_sQ'  with the actual video id being 2jkExrrm_sQ
         $c = array(); //reset memory for temp video object
         //extract youtube id from url
         $c[$this->video_object]['youtube_id'] = preg_replace('/http:\/\/gdata.youtube.com\/feeds\/api\/videos\//','',(string) $entry->id);
         $c[$this->video_object]['author'] = $entry->author->name;
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Mon Feb 26, 2018 10:50 am Reply with quote

The YouTube Data API (v2) has been deprecated since February 26, 2014, and the API has been turned down. Applications still using the v2 API should migrate to the v3 API immediately.
[ Only registered users can see links on this board! Get registered or login! ] [ Only registered users can see links on this board! Get registered or login! ]

v3 API docs: [ Only registered users can see links on this board! Get registered or login! ]

The php class: php5tube is not more supported since 2008 and all related developer websites incl. sourceforge repo are down. This class will not more work with the current Youtube API.
[ Only registered users can see links on this board! Get registered or login! ] [ Only registered users can see links on this board! Get registered or login! ]

In short: This module is completely deprecated - delete it.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©