YouTube API: Dive In

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    YouTube API: Dive In - Presentation Transcript

    1. YouTube API: Dive-In
      HigEdWebDev 2009
      Ron West
    2. Google's mission
      …is to organize the world's information and make it universally accessible and useful. Sometimes making information accessible requires making it available in contexts other than a web browser.
    3. Agenda
      Introduction
      Getting Started
      Get Content
      Interaction
      Pulling it Together
      Developer Community
    4. Introduction
      YouTube in Review
      REST
      Google Data API
      YouTube Data API
      Entries/Feeds
      Authentication
    5. YouTube in Review
      Videos
      Comments
      Ratings
      Users
      Categories
      Keywords/Tags
      Channels
      Subscriptions
      • Messages
      • Activity Feeds
      • Recommendations
      • Friends
      • Related Videos
      • Captions
      • Favorites
      • Insight Data
    6. REST
      REpresentationalState Transfer
      Architectural Style – NOT – Standard
      More akin to Doc Literal than RPC based Web Service
      Logical URL’s vs. Static URL’s
    7. REST
      Client-Server
      Stateless
      Cacheable
      Uniform Interface
      Layered
    8. REST
      HTTP Methods
      Get = List or Retrieve
      Put = Replace or Update
      Post = Create
      Delete = Delete
    9. Pros
      • Single endpoint for all calls
      • Lanugage, platform and transport agnostic
      • Built in error handling
      Cons
      • Conceptually more difficult
      • Harder to develop with (requires tools)
      SOAP (RPC/Doc Literal) Web Services
    10. Multiple Endpoints
      Pros
      • Language and platform agnostic
      • Simpler to develop than SOAP
      • Concise
      Cons
      • Lack of standards
      • Tied to HTTP transport
      REST Web Services
    11. Get API URL’s for:
      • Comments
      • Related Videos
      • Ratings
      • Mobile
      • Versions
      • Get Video(s)
      • Edit Video
      • Delete Video
    12. Google Data API
      RSS vs. Atom
      APP
      Get vs. Post vs. Put vs. Delete
    13. Response Codes
      Same response codes for HTTP
      200, 201, 301, 400, 500 etc..
      Codes have similar meaning for each type of call
      200 (OK)
      400 (Bad Request)
      401 (Not Authorized)
      404 (Not Found)
      500 (Internal Error)
      Accompanied with error details (XML in payload)
    14. YouTube Data API
      Version 1
      Version 2 (recommended)
    15. YouTubeData API
      Search for Videos
      Keywords (tags)
      Categories
      Query Params (metadata)
      Search for Playlists
      Keywords (tags)
      Categories
      Search for Channels
      Keywords (tags)
      Categories
    16. YouTube Data API
      Retrieve
      Videos
      Comments
      Captions
      Related Videos
      Video Responses
      Categories
      Keywords
      Playlists
      Subscriptions
      Profiles
      Contacts
      Messages
      Activity Feeds
      Insight Data Feed
      Favorites
    17. YouTube Data API (cont.)
      Create
      Videos
      Comments
      Captions
      Related Videos
      Video Responses
      Complaint
      Rating
      Contact
      Message
      Favorite
      Playlist
      Subscription
    18. YouTube Data API (cont.)
      Update
      Video Metadata
      Captions
      Profiles
      Playlists
      Contacts
      Delete
      Video
      Message
      Favorite
      Playlist
      Subscription
      Contact
    19. YouTube Data API
      Batch Processing
      Process multiple types of calls in a single request
      Each Request in its own <entry> tag
    20. Sample Interaction
      Query API for videos tagged with “SHU”
      Display Videos in List
      Allow user to Select Video to Display
      Display Single Video
      Retrieve Comments for that Video
      Post Comment
      Login
      Add to Playlist
    21. Feed
      <feed [namespaces]>
      … metadata …
      <openSearch:totalResults />
      <openSearch:startIndex />
      <openSearch: itemsPerPage />
      <entry>
      … metadata …
      <media:group/>
      </entry>
      <entry>
      … metadata …
      <media:group/>
      </entry>

      </feed>
    22. Entry (video)
      <entry [namespaces]>
      <title/>
      <content/>
      … metadata …
      <link rel=“http://gdata.youtube.com/schemas/2007#video.responses “/>
      <link rel=“http://gdata.youtube.com/schemas/2007#video.related” />
      <link rel=“http://gdata.youtube.com/schemas/2007#mobile”/>
      <media:group>
      <media:contentyt:format=“t” url=“…”/>
      <media:thumbnailurl=“…” width=“…” height=“…”/>
      <yt: duration />
      <yt:videoid />
      </ media:group >
      </entry>
    23. Authentication
      AuthSub – YouTube Authentication with “callback” API [difficult]
      OAuth – Standardized Approach (similar in nature to OpenID) [most difficult]
      ClientLogin – Custom Authentication – you call YouTube API track token [easiest]
    24. Getting Started
      Google Developers Key
      Development Environment
      Samples
    25. Google Developers Key
      http://code.google.com/apis/youtube/dashboard/
    26. Development Environment
      Accessing dev servers
      Plugging in Developers Key
    27. Getting YouTube Content
      Standard Feeds
      Discovering Videos
      Channels
      Playlists
      Displaying Videos
    28. Standard Feeds
      http://code.google.com/apis/youtube/2.0/reference.html#Standard_feeds
      Top Rated
      Top Favorites
      Most Viewed
      Most Popular
      Most Recent
      Etc…
      Filter by Time
      Filter by Region
      Filter by Category
    29. Discovering Videos
      Keywords
      Categories
      Categories/Keywords
      Users
    30. Categories
      http://gdata.youtube.com/schemas/2007/categories.cat
      <app:categories [namespaces]>
      <atom:category term="Film" label="Film & Animation" xml:lang="en-US">
      <yt:assignable/>
      <yt:browsable
      regions="AU BR CA CZ DE ES FR GB HK IE IL IN IT JP KR MX NL NZ PL PT RU SE TW US"/>
      </atom:category>
      </app>
    31. Video by Keyword/Tag
      http://gdata.youtube.com/feeds/api/videos/
      Append /-/keyword/ to video feed URL
      Use query string ?category=keyword
      Not (-) Or (|)
      /-/Kennedy/-Bobby/-Ted/-Patrick
      /-/Kennedy/Bobby|Ted|Patrick
    32. Video by Category
      http://gdata.youtube.com/feeds/api/videos/
      Append /-/Category/ to video feed URL
      Use query string ?category=Category
      Multiple Categories
      /-/Comedy/Music/Shortmov/
      ?category=Comedy,Music,Shortmov
      Category ARE case sensitive
    33. Channels
      http://gdata.youtube.com/feeds/api/channels?v=2
      Search just like videos using “?q=keywords/tags”
      <feed [namespaces>
      … metadata …
      <openSearch:totalResults />
      <openSearch:startIndex />
      <openSearch: itemsPerPage />
      <entry>
      <title />
      <summary />
      <gd:feedlinkurl=“…” hitcount=“…”>
      </entry>
      </feed>
    34. Playlists
      http://gdata.youtube.com/feeds/api/playlists/snippets?v=2
      Searchjustlike a Channel
      <feed [namespaces>
      … metadata …
      <openSearch:totalResults />
      <openSearch:startIndex />
      <openSearch: itemsPerPage />
      <entry>
      <title />
      <summary />
      <content src=“…”>
      <yt:countHint />
      <yt:playlistId />
      </entry>
      </feed>
    35. Displaying Videos
      JavaScript API
      Flash API
    36. Interacting with YouTube Content
      Authentication
      Comments
      Ratings
      Updating
      Uploading
    37. ClientLogin
      https://www.google.com/youtube/accounts/ClientLogin
      Pass in:
      Email
      Passwd
      Receive:
      Auth=AIwbFARksypDdUSGGYRI_5v7Z9TaijoPQqpIfCEjTFPAikn_---OC-I1VJtQ
      YouTubeUser=testuser
      Send into all requests:
      Header:
      Authorization = “GoogleLogin auth= AIwbFARksypDdUSGGYRI_5v7Z9TaijoPQqpIfCEjTFPAikn_---OC-I1VJtQ”
    38. Comments
      Get Video Feed
      Look for:
      <gd:comments>
      <gd:feedlinkhref=“…” countHint=“…” />
      </gd:comments>
      Pass in
    39. Ratings
      Link embeded in the video feed
      <link rel='http://gdata.youtube.com/schemas/2007#video.ratings' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/VIDEO_ID/ratings'/>
      Send back to this URL:
      <entry [namespaces]>
      <gd:rating value="4" min="1" max="5"/>
      </entry>
    40. Updating
      Link embeded in the video feed
      <link rel='edit' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/andyland74/uploads/914IMX9RSTE'>
      Send Back to this URL:
      <entry [namespaces]>
      <media:group>
      <media:title type=“…“ />
      <media:description type=“…“ />
      <media:category scheme=“…“ />
      <media:keywords />
      </media:group>
      </entry>
    41. Uploading
      http://uploads.gdata.youtube.com/feeds/api/users
      Include in Header
      Authentication
      Slug (filename)
      Include in Body
      Video File
      <entry [namespace]>
      <media:group>
      <media:title type=”...” />
      <media:description type=“…“ />
      <media:keywords />
      <media:categoryscheme=“…“ />
      </media:group>
      </entry>
    42. Challenges
      Documentation is poor
      No true congruity in related links
      Error messages are non-descriptive
    43. Developer Resources
      Google Group
      http://groups.google.com/group/youtube-api-gdata
      Google Code Help
      http://code.google.com/support/bin/topic.py?topic=12357
    44. Contact
      Ron West
      @notronwest
      facebook.com/notronwest
      www.notronwest.com/blog
    SlideShare Zeitgeist 2009

    + notronwestnotronwest Nominate

    custom

    278 views, 0 favs, 0 embeds more stats

    The YouTube API discovery presentation. Defines the more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 278
      • 278 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 5
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories