5. Getting Started: TV Schedules
â˘âŻ How do I get a key?
Fill out this form:
http://open.pbs.org/pbs-api-key-request/
â˘âŻ What kind of data is returned?
â⯠Read-only REST API or XML RPC
â⯠Returns XML or JSON
â˘âŻ How is it protected?
â⯠Simple key based authentication
6. Understanding the models
Provider
(e.g. Cable Vendor)
Head End A Head End B Station
(e.g. Cable Operator) (e.g. KRWG)
Feed 1 Feed 2 Feed 3 Feed 4
(Channel)
Listing X Listing Y Listing W Listing Z
7. Typical usage walkthrough
Start with a Zip code (Optional)
getHeadEndsByZipTagged getStationsByZip
Find a Head End (Cable Operator) Pick a Station
getStationsByHeadend
Select a Feed (Channel)
getFeedsWithMetadata
getAirdatesByFeed
Pull Listings
11. Agenda : COVE API
â˘âŻ Getting Started
â˘âŻ Understanding the models
â˘âŻ Available Methods
â˘âŻ Typical usage walkthrough
â˘âŻ How to play video
â˘âŻ Authentication
â˘âŻ Whatâs next?
12. Getting Started: COVE API
â˘âŻ How do I get a key?
â⯠Tell you in a bit
â˘âŻ What kind of data is returned?
â⯠Read-only REST API
â⯠COVE API only returns JSON
â˘âŻ How is it protected?
â⯠Hefty authentication mechanism (So no jQuery
access)
â˘âŻ How can I get video?
â⯠Returns only RTMP links, so roll your own HTML
player
13. Understanding the models
WCFE
Producer A (Mountain
Lake PBS)
Program X Program Y Rustic Living
Video 1 Video 2 Video 3 Camp Little
Pine
15. /cove/v1/programs
â˘âŻ Getting all the programs
http://api.pbs.org/cove/v1/programs/
â˘âŻ Getting metadata about one program
http://api.pbs.org/cove/v1/programs/408/
17. /cove/v1/programs - filters
â˘âŻ Getting all national programs
http://api.pbs.org/cove/v1/programs/?filter_producer__name=PBS
â˘âŻ Getting all station programs
http://api.pbs.org/cove/v1/programs/?filter_producer__name=KRMA
18. /cove/v1/videos
â˘âŻ Getting all the videos
http://api.pbs.org/cove/v1/videos/
â˘âŻ Getting metadata about one video
http://api.pbs.org/cove/v1/videos/36032/
19.
20. /cove/v1/videos - filters
â˘âŻ Typical query filters
â⯠Only Available Videos (not expired)
â⯠Of type: Episode, Clip, Segment, Promotion
â⯠That belong to a particular program
â⯠In a compatible encoding format
â˘âŻ Typical output adjustments
â⯠Give me associated images
â⯠Sort by most recent airdate
â⯠Give me 20 at a time
23. Typical usage walkthrough
â˘âŻ App starts and pulls a list of all relevant
programs
â˘âŻ Once user selects a program, the app
should query for a short list of relevant
videos
â˘âŻ If a user selects a video, the app
generates the html needed to stream
24. How to play video
â˘âŻ The COVE API doesnât provide HTML to
play the video (yet)
â˘âŻ Your app has to construct the HTML based
on guidelines at:
http://projects.pbs.org/confluence/display/coveapi/How+to+Render+Videos
25. Sample HTML â Simple link
â˘âŻ From the video JSON, extract:
tp_media_object_id
â˘âŻ Use:
http://video.pbs.org/videos/<tp_media_object_id>
Or
http://video.weta.org/videos/<tp_media_object_id>
26. Sample HTML â Partner Player
â˘âŻ From the video JSON, extract: tp_media_object_id
<iframe id="partnerPlayer" frameborder="0"
marginwidth="0" marginheight="0" scrolling="no"
style="width:512px; height:328px;" src="http://
video.pbs.org/widget/partnerplayer/
<tp_media_object_id>/?player=<player
string>w=512&h=288&chapterbar=true&autoplay=false">
</iframe>
28. Authentication
â˘âŻ Every call to the endpoints must be
authenticated
â˘âŻ Based on OAuth, but is not Oauth
â⯠Two-legged OAuth actually
â˘âŻ Sample implementations provided on the
documentation site
â˘âŻ Front-end a jQuery app using AJAX calls
29. â˘âŻ Active station collaborative efforts to improve existing
products and knowledgebase
â⯠Share ideas
â⯠Compare tricks of the trade
â⯠Solve common problems
â⯠Early product access
â˘âŻ April: COVE API Collaborative Competition
â⯠Participants: KLRU, KPBS, Iowa PTV, TPT, KET,
KCTS, WGBH, Maine PBN, CET, NHPTV
â˘âŻ Coordinated product building activities with openPBS
community
â˘âŻ Visit spiblog.pbs.org to learn more and find out about
future collaborative opportunities
30. How to get COVE API keys
â˘âŻ Fill out this form:
http://open.pbs.org/pbs-api-key-request/
â˘âŻ Will start giving out keys after incubation
lab (early May)
â˘âŻ Check back often in the incubation labs for
new API features and functionality
31. Whatâs next?
â˘âŻ Easy authentication
â⯠Supporting jQuery
â˘âŻ Provided HTML for video playback
â˘âŻ More exciting queries
â⯠Tell me what you want!
32. Links from this presentation
â˘âŻ This presentation
http://open.pbs.org/post/2011-techcon-slides/
â˘âŻ COVE API Docs
http://projects.pbs.org/confluence/display/coveapi/Welcome
â˘âŻ COVE API url
http://api.pbs.org/cove/v1