I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference...

80
I’ve got a key to your API, now what?!? •Presented by: •Thomas Crenshaw – PBS (@justhomas) •Javaun Moradi – NPR (@javaun)

description

PBS’ Tom Crenshaw and NPR’s Javaun Moradi discuss the PBS and NPR APIs. Topics covered are radio, television and dual-licensee stations can leverage the PBS and NPR APIs to innovate and build audience on their websites, mobile devices, and beyond. Tom and Javaun discuss retrieving API content for use on station sites, putting station content into our APIs for reuse elsewhere, and finding station information based on location or call letters. They share their ideas on where the public media APIs are headed, and they look forward to hearing your questions, feedback, and pain points.

Transcript of I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference...

Page 1: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

I’ve got a key to your API, now what?!?

•Presented by:•Thomas Crenshaw – PBS (@justhomas)•Javaun Moradi – NPR (@javaun)

Page 2: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Who are these guys

• Combined 30 years technical experience• Both straddle the line between technically

focused and experience focused• Both work for 3 letter companies and won’t

have to kill you for telling you that (inside the beltway joke)

• Fun fact: both are mountain bikers

Page 3: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

3

Page 4: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Who are you? (Who who who who)

• Just Radio?• Just TV?• Joint licensee?• Digital folks?• Broadcast?• Developers (the software kind)?

Page 5: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Who we think you are

• Some development experience in some development language (python, ruby, javascript)

• Desire to extend your site/app/presence with additional content

• May or may not be a joint licensee• Know that APIs rule the 2.0 world• May or may not know that APIs are actually web

services

Page 6: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Now that introductions are out of the way let’s talk about APIs

Page 7: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

We are going to go through this part of the presentation “Vin

Diesel” style....

Page 8: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

9

Page 9: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

think of this as API speed dating

10

Page 10: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Application Programming Interface (API)

• A flexible toolset. Not a platform, a file format, or a type of content.

• Reuse your own technology, or• Use someone else’s without building it yourself.• Skilled developers program new API applications, but

everyone can use those new creations.

Page 11: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Where did NPR begin?

Page 13: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Vision: “Let a thousand flowers bloom…”

Page 14: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Reality: NPR + Stations + Partners

Page 15: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Rise of Mobile AppsPRX Brad Fluebacher’s

basementNPR

Page 16: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Stations API

Page 17: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Stations API

Page 18: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

APIs you didn’t know we had

• Transcripts• User & Playlist

ROBERT SIEGEL, HOST:

From NPR News, this is ALL THINGS CONSIDERED. I'm Robert Siegel.

MELISSA BLOCK, HOST:

And I'm Melissa Block.

We're marking the 50th anniversary of a children's classic that's still devoured and puzzled over in reading

nooks and classrooms.

KEVIN THOMPSON: So we got Mrs. Whatsit, what about the 2nd character that we met?

UNIDENTIFIED GROUP: Mrs. Who.

THOMPSON: Mrs. Who, OK. What did we learn about Mrs. Who?

UNIDENTIFIED CHILD #1: That her glasses are thick.

THOMPSON: Yes, she has thick glasses. What kind of...

UNIDENTIFIED CHILD #2: She has spectacles.

THOMPSON: They call them spectacles, very good. What else is...

Page 19: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

NPR Now…

Page 20: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

NPR Mobile Today

Page 21: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Station & Show Apps!

Page 22: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Cars!

Page 23: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Experiments

Page 24: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

NPR Doubled Page Views

NPR News iPhone app

NPR News Android app

Relaunched NPRmobile site

NPRiPad app

NPR MusiciPhone app

API launchedin 2008

NPR MusicRemix

NPR BlogsMade API Friendly

Facebook Integration

Player 2.0

Homepage Improvements

Story PageImprovements

Page 25: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Stations Doubling Traffic!

Page 26: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)
Page 27: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

NPR API stuff in progress

Page 28: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Plugging Asset Gaps

<externalAsset id="141487365" type="YouTube"> <url>http://www.youtube.com/watch?v=Ws6AAhTw7RA</url><http://www.youtube.com/watch?v=Ws6AAhTw7RA%3C/url%3E> <oEmbed>http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch%3Fv%3DWs6AAhTw7RA</oEmbed> <externalId>Ws6AAhTw7RA</externalId> <credit/> <parameters/> <caption/></externalAsset>

Page 29: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Station Ingest:150 by the end of 2012!

Page 30: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)
Page 31: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

API-Centered Development

• Rule 1: Everything is an API• Rule 2: Be RESTful• Rule 3: Drink Your Own...

Page 32: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Streams & Genres APIsGET:

/genres/10003/streams/

Page 33: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

33

Page 34: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Artemis Library APIGET

/stories/?names={"or":[{"name":"Newt%20Gingrich","role":"4"},{"name":"Newt%20Gingrich","role":"1"}]}

Page 35: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)
Page 36: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

NPR what’s next?

47

Page 37: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Station Data Project (BUS)

• Schedule information• Bridge existing information, including:

– Station localization– Streams directories

• Lots of bad puns

Page 38: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Stream Validation 

Page 39: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Update Our Old Documentation

Page 40: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Better Documentation and Support

Page 41: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

The API in the beginning… 

Page 42: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Ingest is getting complicated

Page 43: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Where we’re headed 

Page 44: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

An API for the System

• Independent of any one CMS or data structure

• More flexibility• Versioning• Rights/permissions

Page 45: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Trends

Page 46: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

JSON APIs

<response> <status> <version>4.2</version> <code>0</code> <message>Success</message> </status> <songs> <song> <artist_id>ARH6W4X1187B99274F</artist_id> <id>SOWKEUN12AF72AB837</id> <artist_name>Radiohead</artist_name> <title>Climbing Up The Walls</title> </song> <song> <artist_id>ARH6W4X1187B99274F</artist_id> <id>SOXZVWD1316771449E</id> <artist_name>Radiohead</artist_name> <title>Fake Plastic Trees</title> </song> <song> <artist_id>ARH6W4X1187B99274F</artist_id> <id>SOMLGKF12AB017DF3C</id> <artist_name>Radiohead</artist_name> <title>Vegetable (Live)</title> </song> </songs></response>

{ response: { status: { version: '4.2', code: 0, message: 'Success' }, songs: [ { artist_id: 'ARH6W4X1187B99274F', id: 'SOWKEUN12AF72AB837', artist_name: 'Radiohead', title: 'Climbing Up The Walls' }, { artist_id: 'ARH6W4X1187B99274F', id: 'SOXZVWD1316771449E', artist_name: 'Radiohead', title: 'Fake Plastic Trees' }, { artist_id: 'ARH6W4X1187B99274F', id: 'SOMLGKF12AB017DF3C', artist_name: 'Radiohead', title: 'Vegetable (Live)' } ] }}

XML JSON

Page 47: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Smaller, Simpler APIs

GET/genres

Page 48: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

CMS Convergence

• Harder to go it alone• A few CMS/frameworks will dominate• Let’s share modules! Don’t reinvent the wheel • http://drupal.org/project/npr

Page 49: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Technology: Shiny new things!

Page 50: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

We need local, segmented audio!

Page 51: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

An ecosystem for sharing

Page 52: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

NPR is hiring!http://www.npr.org/about/careers/

Digital Media (Washington, D.C.)•Programmer III•News Apps Editor •Quality Assurance Engineer•Software Developer •Audio-Video Production Supervisor •Product Manager, Connected Cars •Lead User Experience Architect

Digital Services (Boston)•Digital News Specialist •Project Coordinator•Programmer III •Web Application Developer IV•Client Services Manager •Client Services Associate

Page 53: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Hey what about PBS...we have APIs too...

Page 54: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

TV Schedules

21

I couldn’t resist the image of an Imperial Walker painted like the Mystery Machine!although it really doesn’t have much to do with the TVSS API!

Very little knowledge passed down through the PBS Interactive group aboutthe origins of the TVSS API (see “mystery” wrapping large cumbersome object....you get it now right?)

Page 55: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

It works....

• Although not without blemishes, it does work• Pass parameters into TVSS API• API returns TV schedule data back• Documentation greatly improved recently by

WETA’s Jess Snyder• Built for single purpose, extended overtime to

do handle other tasks that

22

Page 56: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

WPT Examplehttp://wptschedule.org/schedulenow.php

23

Page 57: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

2424

PBS Tune-in iOS App

Page 58: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

58

COVE API

• Request video object• Get video object• Pretty simple at its core• Manual key management at PBS• Public key available for POC

Page 59: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

5959

WordPress Plugin

WNET built it and is using it in production

code is public on GitHub

Page 60: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

60

Page 61: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

61

Other APIs

Page 62: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Image Transformation Service (ITS)On-the-fly image resizing using URL decorators

http://image.pbs.org/ramp/programs/logos/NOVA_mezz_16x9.pnghttp://image.pbs.org/ramp/programs/logos/NOVA_mezz_16x9.png.resize.103x58.png

Page 63: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

63

Universal User Authentication (UUA)

Page 64: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Hey PBS ... what are you working on now?

Page 65: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

65

Localization

Page 66: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

66

Passed in parameters: ZIP, IP or CoordinatesReturn: Call signFilter and rank as necessary with additional parameters

Simplify the obvious

Page 67: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

67

Document from the beginning, not as an afterthought

Page 68: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

68

TV Schedules Rethunk

Page 69: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

~300 x 24 x 21 x 3 x 4 = ~1.8 million records

(Actually closer to 2.629492 million records in PBS TV Schedules grid of information but who’s counting)

44

Page 70: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

70

Not the best user experience

Page 71: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

7171

assume the role of a viewer

Page 72: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

72

Build a robust API that fits the viewers needs and the user

experiences will follow

Page 73: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

73

Mashup

COVE API + TVSSReloaded = EPG Nirvana

Page 74: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

74

One ID to rule them all

Page 75: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

75

Ask the questionwhere can I watch a PBS

program?Yesterday

Page 76: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

76

Today

Page 77: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

77

Now that you know what we are doing...

what can we do for you while we are doing what we are doing?

open discussion begins.....now

Page 78: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

78

API Reference

• NPR– NPR API– Transcripts– User– Playlist– Stations– Streams & Genres– Artemis

• PBS– TV Schedules– COVE– ITS– UUA– Localization– TVSS Rethunk– PBSGUIDPROJECT

Page 79: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

79

PBS URLs

• http://open.pbs.org - open PBS• http://answers.open.pbs.org - Q&A site• https://github.com/pbs - PBS github site

• http://to.pbs.org/docs-api-cove• http://to.pbs.org/docs-api-tvss• http://to.pbs.org/docs-api-its• http://to.pbs.org/docs-api-uua

79

Page 80: I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Give at IMA Conference March 2012)

Questions?

Tom [email protected]@justhomashttp://open.pbs.org/

Javaun [email protected]@javaun

64