How To Query Google Feed Without Downloading Entire Feed?

Discussion in 'Google API' started by johnywhy, Dec 7, 2007.

  1. #1
    is it possible to query a feed for a particular value, without
    downloading the entire feed?

    specifically, i want to query the following feed for LastBuildDate,
    which is in the header of the feed:

    http://gdata.youtube.com/feeds/api/playlists/9A337BB0628CF018?start-index=1&max-results=50

    it appears at the bottom of this feed fragment:

    <?xml version="1.0" encoding="utf-8" ?>
    - <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005">
    - <channel xmlns:cfi="http://www.microsoft.com/schemas/rss/core/2005/
    internal" cfi:lastdownloaderror="None">
    <link>http://www.youtube.com/view_play_list?p=9A337BB0628CF018</
    link>
    - <image>
    <url>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</url>
    <title>Impeach</title>
    <link>http://www.youtube.com/view_play_list?p=9A337BB0628CF018</
    link>
    </image>
    <cf:guid isPermaLink="false">http://gdata.youtube.com/feeds/api/
    playlists/9A337BB0628CF018</cf:guid>
    <atom:updated>2007-12-05T09:45:26Z</atom:updated>
    <lastBuildDate>Wed, 05 Dec 2007 09:45:26 GMT</lastBuildDate>
     
    johnywhy, Dec 7, 2007 IP
  2. johnywhy

    johnywhy Active Member

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    88
    #2
    resolved using php5 "get_headers"

    <?php
    $url = 'http://gdata.youtube.com/feeds/api/playlists/9A337BB0628CF018?start-index=1&max-results=50';
    
    $myarray=get_headers($url,1);
    
    $mydate=$myarray['Last-Modified'];
    
    print($mydate);
    
    ?>
    PHP:
     
    johnywhy, Dec 9, 2007 IP