0

私は Iphone を初めて使用し、利用可能なチュートリアルがたくさんあることを知っています。また、たくさん検索しましたが、次の XML ファイルを読み取ることができませんでした。あなたが私を助けてくれることを願っています。以下を読みたい。1. ViewCounts 2. Media:Thumbnail 3. Media:Title 4. NumRates 5. Duration

前もって感謝します。

<?xml version="1.0" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005" xmlns:media="http://search.yahoo.com/mrss/" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:yt="http://gdata.youtube.com/schemas/2007">
  <id>
    http://gdata.youtube.com/feeds/api/videos
  </id>
  <updated>
    2012-04-08T15:09:04.640Z
  </updated>
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/>
  <title type="text">
    YouTube Videos matching query: pakistan
  </title>
  <logo>
    http://www.youtube.com/img/pic_youtubelogo_123x63.gif
  </logo>
  <link href="http://www.youtube.com" rel="alternate" type="text/html"/>
  <link href="http://gdata.youtube.com/feeds/api/videos" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
  <link href="http://gdata.youtube.com/feeds/api/videos/batch" rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"/>
  <link href="http://gdata.youtube.com/feeds/api/videos?alt=atom&start-index=1&max-results=1&vq=pakistan&orderby=relevance" rel="self" type="application/atom+xml"/>
  <link href="http://gdata.youtube.com/feeds/api/videos?alt=atom&start-index=2&max-results=1&vq=pakistan&orderby=relevance" rel="next" type="application/atom+xml"/>
  <author>
    <name>
      YouTube
    </name>
    <uri>
      http://www.youtube.com/
    </uri>
  </author>
  <generator uri="http://gdata.youtube.com" version="2.1">
    YouTube data API
  </generator>
  <openSearch:totalResults>
    1000000
  </openSearch:totalResults>
  <openSearch:startIndex>
    1
  </openSearch:startIndex>
  <openSearch:itemsPerPage>
    1
  </openSearch:itemsPerPage>
  <entry>
    <id>
      http://gdata.youtube.com/feeds/api/videos/QP9K2YeO6kE
    </id>
    <published>
      2012-04-08T05:51:35.000Z
    </published>
    <updated>
      2012-04-08T14:18:21.000Z
    </updated>
    <category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/>
    <category label="News & Politics" scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="News"/>
    <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Pakistan"/>
    <category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="Avalanche"/>
    <title type="text">
      Avalanche Buries More Than 100 Pakistani Troops
    </title>
    <content type="text">
      Pakistani soldiers dug into a massive avalanche in a mountain battleground close to the Indian border on Saturday, searching for at least 135 people buried when the wall of snow engulfed a military complex. (April 7)
    </content>
    <link href="http://www.youtube.com/watch?v=QP9K2YeO6kE&feature=youtube_gdata" rel="alternate" type="text/html"/>
    <link href="http://gdata.youtube.com/feeds/api/videos/QP9K2YeO6kE/responses" rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml"/>
    <link href="http://gdata.youtube.com/feeds/api/videos/QP9K2YeO6kE/related" rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml"/>
    <link href="http://m.youtube.com/details?v=QP9K2YeO6kE" rel="http://gdata.youtube.com/schemas/2007#mobile" type="text/html"/>
    <link href="http://gdata.youtube.com/feeds/api/videos/QP9K2YeO6kE" rel="self" type="application/atom+xml"/>
    <author>
      <name>
        AssociatedPress
      </name>
      <uri>
        http://gdata.youtube.com/feeds/api/users/AssociatedPress
      </uri>
    </author>
    <gd:comments>
      <gd:feedLink countHint="55" href="http://gdata.youtube.com/feeds/api/videos/QP9K2YeO6kE/comments" rel="http://gdata.youtube.com/schemas/2007#comments"/>
    </gd:comments>
    <yt:location>
      New York, NY
    </yt:location>
    <media:group>
      <media:category label="News & Politics" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">
        News
      </media:category>
      <media:content duration="53" expression="full" isDefault="true" medium="video" type="application/x-shockwave-flash" url="http://www.youtube.com/v/QP9K2YeO6kE?version=3&f=videos&app=youtube_gdata" yt:format="5"/>
      <media:content duration="53" expression="full" medium="video" type="video/3gpp" url="rtsp://v6.cache4.c.youtube.com/CiILENy73wIaGQlB6o6H2Ur_QBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp" yt:format="1"/>
      <media:content duration="53" expression="full" medium="video" type="video/3gpp" url="rtsp://v4.cache8.c.youtube.com/CiILENy73wIaGQlB6o6H2Ur_QBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp" yt:format="6"/>
      <media:description type="plain">
        Pakistani soldiers dug into a massive avalanche in a mountain battleground close to the Indian border on Saturday, searching for at least 135 people buried when the wall of snow engulfed a military complex. (April 7)
      </media:description>
      <media:keywords>
        Pakistan, Avalanche
      </media:keywords>
      <media:player url="http://www.youtube.com/watch?v=QP9K2YeO6kE&feature=youtube_gdata_player"/>
      <media:thumbnail height="360" time="00:00:26.500" url="http://i.ytimg.com/vi/QP9K2YeO6kE/0.jpg" width="480"/>
      <media:thumbnail height="90" time="00:00:13.250" url="http://i.ytimg.com/vi/QP9K2YeO6kE/1.jpg" width="120"/>
      <media:thumbnail height="90" time="00:00:26.500" url="http://i.ytimg.com/vi/QP9K2YeO6kE/2.jpg" width="120"/>
      <media:thumbnail height="90" time="00:00:39.750" url="http://i.ytimg.com/vi/QP9K2YeO6kE/3.jpg" width="120"/>
      <media:title type="plain">
        Avalanche Buries More Than 100 Pakistani Troops
      </media:title>
      <yt:duration seconds="53"/>
    </media:group>
    <gd:rating average="4.7647057" max="5" min="1" numRaters="17" rel="http://schemas.google.com/g/2005#overall"/>
    <yt:recorded>
      2012-04-08
    </yt:recorded>
    <yt:statistics favoriteCount="4" viewCount="662"/>
  </entry>
</feed>
4

2 に答える 2

0

もう 1 つのオプションは、GDataXmlParserを使用することです(Google で検索し、準備ができているファイル)。タグを渡すだけで、辞書が返されます。

于 2012-04-08T16:32:11.790 に答える