1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP and Youtube API

Discussion in 'PHP' started by krjewellers, May 23, 2011.

  1. #1
    I know Youtube has a Developer Forum, but I came here out of
    habit. Hope someone whose familiar with the Youtube API can
    assist me.

    Problem: I believe I'm hitting the Youtube API call limit across
    my network of websites. I need to know how to print or echo
    using PHP the error message the Youtube API is returning.
    Thanks in advance.
     
    krjewellers, May 23, 2011 IP
  2. IAreOwn

    IAreOwn Active Member

    Messages:
    46
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    95
    #2
    well youtube api will return an http response as well as an xml response whenever you hit the api call limit, you can just check the http response to see if you have reach the call limit and then parse the xml that it return
     
    IAreOwn, May 23, 2011 IP
  3. krjewellers

    krjewellers Internet Fan

    Messages:
    191
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    88
    #3
    Yes, that is exactly what I need to do, but I haven't been able
    to figure out how to do it. I need a sample code. Then, I could
    do it. I'm stuck, but that is exactly what I want to do. Would
    you post a code sample?
     
    krjewellers, May 23, 2011 IP
  4. ngcoders

    ngcoders Active Member

    Messages:
    206
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    If the parsing of the XML response fails to deliver the video details means its an error , log that request.
     
    ngcoders, May 24, 2011 IP
  5. krjewellers

    krjewellers Internet Fan

    Messages:
    191
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    88
    #5
    Thanks for the insight. I will work with trying to log the request for I can tell what is happening.
    If anyone who like to share a snippet of code, it is appreciated. Thanks.
     
    krjewellers, May 24, 2011 IP