• I am working on a website, and there was a function that would display a list of the users videos. Now I am just getting this error:

    Warning: file_get_contents(https://www.youtube.com/feeds/videos.xml?channel_id=UCqWTiyd9_A6oAOKHJkDOlZQk) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in /home1/USERNAME/public_html/wp-content/themes/mythemehere/functions.php on line 570

    Now here is the included function where the error originates as follows:

    And here is the php on the page for which I am calling it:
    //then where issue is called
    //keep in mind I wrote none of this, just trying to fix it

    From what I have read is that YouTube has updated their API from 2 to 3 and have completely shutdown 2. So any help to point me in the right direction. I have searched on here, but they seem to all be tied to specific plugins, not just a random bit of custom code. Any and all help is appreciated.. I have tried some alterations, but to no avail. Please help…

Viewing 1 replies (of 1 total)
  • Thread Starter Graphics1

    (@graphics1)

    This is the function inside of functions.php onl ine 570

    function fetch_youtube_rss($cache_len = 3600) {
      $tubes = get_transient('youtube_rss_feed');
      if (!$tubes) {
        $url = 'https://gdata.youtube.com/feeds/base/users/themidgetgrimm/uploads?alt=rss';
        if ($contents = file_get_contents($url)) {
          $xml = simplexml_load_string($contents);
          $tubes = array();
          foreach($xml->channel->item as $item) {
            $tubes[] = @json_decode(@json_encode($item));
          }
        } else {
          return false;
        }
        set_transient('youtube_rss_feed', $tubes, $cache_len);
      }
      return $tubes;
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Update existing function for YouTube API 3.0 from 2.0’ is closed to new replies.