Youtube API Standard feeds On Website?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Youtube API Standard feeds On Website?

    Hi there,

    I'm wondering If anyone can assist me. I am currently a design student In Leeds, UK.

    I'm create a online campaign whereby customers use QR codes to link to a created website with interesting youtube video on.

    At the moment I've just created a simple link to the chosen content

    Website version 1

    However I've come across Youtube API Standard feeds on the Youtube Reference Guide. Reference Guide: Data API Protocol - YouTube APIs and Tools - Google Code

    It states you can 'send a GET request to the URL associated with that feed', however, I've never really touched php before. Could anyone give me advise on how I would link this feed to my site? Would that be difficult?

    Many replies would be much appreciated!

    Regards

    David.

    #2
    hi,

    which informations would you like to grab from youtube api?

    video description, tags, keywords title, views etc?

    or

    a list with related videos/top videos/ recently added videos or a playlist?

    Added after 7 minutes:

    to send a get request with php is simple, you can use curl or other methods:

    PHP Code:
    <?php
    $url 
    'https://gdata.youtube.com/feeds/api/standardfeeds/most_popular'/* youtube feed url with most popular videos */
        
    $ch curl_init();
    curl_setopt($chCURLOPT_URL$url);
    curl_setopt($chCURLOPT_HEADER0);
    curl_setopt($chCURLOPT_FAILONERRORTRUE);
    curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    curl_setopt($chCURLOPT_CONNECTTIMEOUT3);
    $feed_content curl_exec($ch);
    curl_close($ch);

    echo 
    $feed_content// show the feed output

    ?>
    or like this:

    PHP Code:
    <?php
    $url 
    'https://gdata.youtube.com/feeds/api/standardfeeds/most_popular'/* youtube feed url with most popular videos */
    $feed_content file_get_contents($url);
    echo 
    $feed_content// show the feed output
    ?>
    Last edited by GumSlone; 03.01.12, 03:03.
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      This post gave me some idea. Thanks gumslone. Such a genius guy.

      Comment

      Working...
      X