PBS Localization+ API Webinar

24
Localization+ Thomas Crenshaw Dir, Technical Product Management

description

Webinar presented by Thomas Crenshaw to a gathering of member stations that outlines the new and improved PBS Localization API.

Transcript of PBS Localization+ API Webinar

Page 1: PBS Localization+ API Webinar

Localization+Thomas Crenshaw

Dir, Technical Product Management

Page 2: PBS Localization+ API Webinar

AgendaBy the conclusion of this webinar, my hope is that you will have gained an understanding of the:• data import process• data sources used• new algorithm• API exploration and testing tools

Page 3: PBS Localization+ API Webinar

BackgroundWhy update PBS station localization? Our goal was to provide a technical solution that satisfies the basic viewer question:

What local PBS stations can I watch on my TV?

We built this web-service to be as flexible and future-proof as possible and to meet the needs of all PBS stations, despite differing station business requirements.

Lesson learned: Without exception, every rule has an exception!

Page 4: PBS Localization+ API Webinar

Terms and DefinitionsLocalizationThe process a site visitor goes through to determine which PBS stations are available in his or her geographic area.

MSOTechnically only applies to a cable system operator, but we will include satellite companies as well.Example: Comcast, University of Wisconsin

HeadendDistribution network for television programming, serving a local community of variable size.Example: Comcast - Sebastian, UW Madison - Madison

Flagship Call SignFCC-licensed owner and/or operator of one or more full-power transmission towers.Example: WXEL, WPNE, KAID

Call SignFull-power transmission tower owned and/or operated by a flagship station.Example: WXEL,WHA, KUID

Rovi Station FeedsRovi representation of a station’s channels and sub-channels.Example: WXELDT3 V-me, WHADT2, KUID World

Page 5: PBS Localization+ API Webinar

The Numbers The sheer volume of data necessary to provide localization at the national level is astounding.• 1,283 MSOs• 11,322 Headends• 515,742 Headend/ZIP code pairs• 180 Flagship call signs• 873 Call signs (full-power and translators)• 1,412 Rovi station feeds• ~42,000 ZIP codes

Data as of 2012-07-23

Page 6: PBS Localization+ API Webinar

What’s DifferentThe Good Legacy Localization+

Sources 1 (Nielsen) Multiple (Rovi,Nielsen)Data Updates Yearly Daily

Troubleshooting Difficult EasyBuilt for TV Schedules LocalizationArchitecture Non-standard RESTfulTechnical Changes Difficult EasyUser Tools None Goliat, BluebellImport Logging None CustomizableData Changes Impossible PossibleTransparency None Open Source

Page 7: PBS Localization+ API Webinar

What’s DifferentThe New Localization+

Results More stationsGeolocation Not always accurateIP Based Input Not always accurateProxy-based IP Not always accurateStatic Files Used for lookups to match Rovi/Nielsen/PBS data

Page 8: PBS Localization+ API Webinar

Get All HeadendsGet All

Headends

ZIP

Step 1: Get All HeadendsFor a given ZIP code, retrieve all available headends from Rovi.

Page 9: PBS Localization+ API Webinar

Update Confidence

Step 2: Update the “Confidence” Value“Confidence” is a relative numeric value that represents how likely the member station is available for a given ZIP code.

All headends are assigned an initial confidence of 100. This value is lowered based on parameters associated with the headend listings.

The highest headend confidence is assigned to applicable stations at end of the import process.

A static file with known bad headends and associated confidence is used.

Get All Headend

s

ZIP

Update Confidence

1 of 3

Page 10: PBS Localization+ API Webinar

Update Confidence

Step 2a: Compare to BlacklistHeadends that contain stations that are obviously out of area.•Confidence dropped to 80•Currently this is only Dish Network, which lists KGTV, WTTW, KRMA in almost all DMAs

headend_id headend_name dma_rank dma_code headend_state vendor_mso_id mso_name

320591 Dish Network - Philadelphia 504 4 DE 300264 Echostar Communications Corp.

Headends that have consistently bad channel line-up data.•Confidence dropped to 0

headend_id headend_name dma_rank dma_code headend_state vendor_mso_id mso_name

307250 Shaw Direct - Eastern Time Zone 300513 Shaw Direct

320209 C-Band Providers - C-Band Eastern Time 301530 Data Services Product

321898 Eastern Time Zone - Eastern Time Zone N/A 301530 Data Services Product

322141 Bell TV - Eastern Time Zone 300818 Data Services Product

Compare to

Blacklist

Update ConfidenceZIP

Get All Headend

s

2 of 3

Page 11: PBS Localization+ API Webinar

Update Confidence

Check DMAZIP

Get All Headend

s

Compare to

Blacklist

Step 2b: Check DMAHeadends that do not have DMA Code or DMA Rank have their confidence lowered to 40.

headend_id headend_name dma_code dma_rank headend_state vendor_mso_id mso_name

322924 Verizon FIOS TV of SE PA - Verizon FiOS-N. DE DE 301762 Verizon Service Corp

Update Confidence

3 of 3

Page 12: PBS Localization+ API Webinar

Get Feed(s) per

Headend

ZIPGet All

Headends

Compare to

Blacklist

Check DMA

Get Feed(s) per Headend

Update Confidence

Step 3: Get Feed(s) per HeadendGet all associated Rovi station feeds for a given headend.

1 of 2

Page 13: PBS Localization+ API Webinar

headend_id headend_name station_id call_letters20547 Starview Cablevision - Forwood - Wilmington 2406 NJTV

Confidence: 100 5964 PBS317727 Comcast - New Castle 247 WHYY

Confidence: 100 1564 WNJS9856 WHYYHD9856 WHYYHD11892 NJTV15985 Y Arts17699 Y Info

320478 DirecTV - Philadelphia 247 WHYYConfidence: 100 304 WLVT

1564 WNJS5964 PBS9856 WHYYHD10991 LINK15866 WLVTD1

320591 Dish Network - Philadelphia 247 WHYYConfidence: 80 304 WLVT

548 WTTW927 KRMA1564 WNJS5964 PBS8643 WGTV10991 LINK

321054 Broadcast TV - Philadelphia 9856 WHYYHDConfidence: 100 9857 WLVTD4

11892 NJTV11895 WNJT-DT13729 WNJSDT15866 WLVTD115868 WLVTV15985 Y Arts17699 Y Info

322333 Verizon FIOS TV of SE PA - Verizon FIOS S NJ 247 WHYYConfidence: 40 304 WLVT

1564 WNJS9856 WHYYHD9857 WLVTD413729 WNJSDT15866 WLVTD115868 WLVTV15985 Y Arts17699 Y Info

headend_id headend_name station_id call_letters307250 Shaw Direct - Eastern Time Zone 719 KCTS

Confidence: 0 959 KSPS2273 WNED2666 WTVS10884 WTVSH

320209 C-Band Providers - C-Band Eastern Time 5964 PBSConfidence: 0 10991 LINK

321898 Eastern Time Zone - Eastern Time Zone 5964 PBSConfidence: 0

322141 Bell TV - Eastern Time Zone 206 WGBHConfidence: 0 719 KCTS

719 KCTS2666 WTVS9873 KCTSD11815 WGBHW

322924 Verizon FIOS TV of SE PA - Verizon FiOS-N. DE 247 WHYYConfidence: 100 304 WLVT

2378 WNJT9856 WHYYHD9857 WLVTD413729 WNJSDT15866 WLVTD115868 WLVTV15985 Y Arts17699 Y Info

323910 Eastern Time Zone - Eastern Time Zone 5964 PBSConfidence: 0

324883 Shaw Direct Advanced - Eastern Time Zone 719 KCTSConfidence: 0 959 KSPS

2273 WNED2666 WTVS10884 WTVSH

325708 Armstrong Utilities - National/Eastern 5964 PBSConfidence: 0

Key Valid station for the headendQuestionable station for the headendInvalid station for the headendStation that does not exist for localization purposes

Get Feed(s) per Headend

2 of 2

Page 14: PBS Localization+ API Webinar

Map Feed(s) to Call Sign

stations.txt + hand curated == rovi_stations2callsign.csv

Get Feed(s) per

Headend

ZIPGet All

Headends

Compare to

Blacklist

Check DMA

Update Confidence

Map Feed(s) to Call Sign

Step 4: Map Rovi Station Feed(s) to PBS Call SignUse static CSV file to map Rovi station id to PBS call sign.

rovi_station_id rovi_station_short_name pbs_callsign pbs_station_flagship_callsign confidence247 WHYY WHYY WHYY 1009856 WHYYDT WHYY WHYY 10015985 WHYYDT2 WHYY WHYY 10017699 WHYYDT3 WHYY WHYY 1002378 WNJT WNJT WNJT 10011895 WNJTDT WNJT WNJT 100304 WLVT WLVT WLVT 1009857 WLVTDT4 WLVT WLVT 10015866 WLVTDT WLVT WLVT 10015868 WLVTDT3 WLVT WLVT 1001564 WNJS WNJS WNJT 10013729 WNJSDT WNJS WNJT 1002406 WNJTV WNJN WNJT 1008643 WGTV WGTV WGTV 80927 KRMA KRMA KRMA 80548 WTTW WTTW WTTW 80719 KCTS KCTS KCTS 0206 WGBH WGBH WGBH 0

Page 15: PBS Localization+ API Webinar

rovi_station_id rovi_station_short_name pbs_callsign pbs_station_flagship_callsign confidence247 WHYY WHYY WHYY 1009856 WHYYDT WHYY WHYY 10015985 WHYYDT2 WHYY WHYY 10017699 WHYYDT3 WHYY WHYY 1002378 WNJT WNJT WNJT 10011895 WNJTDT WNJT WNJT 100304 WLVT WLVT WLVT 1009857 WLVTDT4 WLVT WLVT 10015866 WLVTDT WLVT WLVT 10015868 WLVTDT3 WLVT WLVT 1001564 WNJS WNJS WNJT 10013729 WNJSDT WNJS WNJT 1002406 WNJTV WNJN WNJT 1008643 WGTV WGTV WGTV 80927 KRMA KRMA KRMA 80548 WTTW WTTW WTTW 80719 KCTS KCTS KCTS 0206 WGBH WGBH WGBH 0

Map Feed(s) to Call Sign

Get Feed(s) per

Headend

ZIPGet All

Headends

Compare to

Blacklist

Check DMA

Update Confidence

Apply Headend Confidence

Step 5: Apply Headend Confidence to Call SignsAssign the highest headend confidence value to each call sign. This allows the calling application to make a logical determination as to validity of returned data.

Apply Headend

Confidence

1 of 2

Page 16: PBS Localization+ API Webinar

321054 Broadcast TV - Philadelphia 9856 WHYYHDConfidence: 100 9857 WLVTD4

11892 NJTV11895 WNJT-DT13729 WNJSDT15866 WLVTD115868 WLVTV15985 Y Arts17699 Y Info

Broadcast TV - Philadelphia

320591 Dish Network - Philadelphia 247 WHYYConfidence: 80 304 WLVT

548 WTTW927 KRMA1564 WNJS5964 PBS8643 WGTV10991 LINK

Dish Network - Philadelphia

323910 Eastern Time Zone - Eastern Time Zone 5964 PBSConfidence: 0

Eastern Time Zone - Eastern Time Zone

322141 Bell TV - Eastern Time Zone 206 WGBHConfidence: 0 719 KCTS

719 KCTS2666 WTVS9873 KCTSD11815 WGBHW

Bell TV - Eastern Time Zone

WHYYConfidence: 100

WLVTConfidence: 100

WNJSConfidence: 100

KRMAConfidence: 80

WGBHConfidence: 0

Apply Headend Confidence

2 of 2

Page 17: PBS Localization+ API Webinar

Step 6: Map Call Sign to FlagshipEvery call sign is assigned a flagship for purposes of providing a single entity to facilitate donation links, station logos, etc.

Map Feed(s) to Call Sign

Get Feed(s) per

Headend

ZIPGet All

Headends

Compare to

Blacklist

Check DMA

Update Confidence

Map Call Sign to Flagship

Apply Headend

Confidence

rovi_station_id rovi_station_short_name pbs_callsign pbs_station_flagship_callsign confidence247 WHYY WHYY WHYY 1009856 WHYYDT WHYY WHYY 10015985 WHYYDT2 WHYY WHYY 10017699 WHYYDT3 WHYY WHYY 1002378 WNJT WNJT WNJT 10011895 WNJTDT WNJT WNJT 100304 WLVT WLVT WNJT 1009857 WLVTDT4 WLVT WNJT 10015866 WLVTDT WLVT WNJT 10015868 WLVTDT3 WLVT WNJT 1001564 WNJS WNJS WNJT 10013729 WNJSDT WNJS WNJT 1002406 WNJTV WNJN WNJT 1008643 WGTV WGTV WGTV 80927 KRMA KRMA KRMA 80548 WTTW WTTW WTTW 80719 KCTS KCTS KCTS 0206 WGBH WGBH WGBH 0

Map Call Sign to Flagship

Page 18: PBS Localization+ API Webinar

Step 7: Assign Sorting FilterCurrently, Nielsen data is used to sort applicable stations within a given ZIP code.

The new architecture employed in the updated localization service allows us to modify the import algorithm as business requirements change.

An example of this could be the addition of a flagship station’s home DMA as a sorting filter.

Numeric rank is transformed from the absolute value Nielsen provides to a relative value within the ZIP code.

Map Feed(s) to Call Sign

Get Feed(s) per

Headend

ZIPGet All

Headends

Compare to

Blacklist

Check DMA

Update Confidence

Assign Sorting Filter

Apply Headend

Confidence

Map Call Sign to Flagship

Apply Sorting Filter

Page 19: PBS Localization+ API Webinar

API Output"$items": [ { "confidence": 100, "$class": "CallSign2ZipMapping", "rank": 1, "$self": "http://services-qa.pbs.org/callsigns/zip/19801/WHYY.json", "$links": [ { "$links": [ { "$links": [ { "$accepts": [ { "$type": "application/vnd.pbs-resource+json", "$class": "Callsign" } ], "$relationship": "children", "$elements": "Callsign", "$self": "http://services-qa.pbs.org/callsigns/station/119.json" }, { "$type": "application/vnd.pbs-resource+json", "$class": "Callsign", "$relationship": "flagship", "callsign": "WHYY", "$self": "http://services-qa.pbs.org/callsign/WHYY.json" } ], "mailing_state": "PA", "$type": "application/vnd.pbs-resource+json", "$class": "Station", "$relationship": "parent", "$self": "http://services-qa.pbs.org/station/119.json", "mailing_city": "Philadelphia", "$created": "2012-06-28T04:24:59-04:00", "short_common_name": "WHYY", "common_name": "WHYY", "$edited": "2012-06-28T04:24:59-04:00" }, { "$type": "application/vnd.pbs-collection+json", "$relationship": "children", "$elements": "Feed", "$self": "http://services-qa.pbs.org/feeds/callsign/WHYY.json" } ], "$class": "Callsign", "$relationship": "related", "$self": "http://services-qa.pbs.org/callsign/WHYY.json", "callsign": "WHYY", "$type": "application/vnd.pbs-resource+json" } ] },

Page 20: PBS Localization+ API Webinar

Localization+ Data Flow

ZIP Code Input

Get All Headends

Compare to HE ‘Blacklist’

Check Headend DMA

Update Confidence

Get Feed(s) per Headend

Map Feed(s) to Call Sign

Apply HE Confidence

API Output

Map Call Sign to Flagship

Apply Sorting Filter

Page 21: PBS Localization+ API Webinar

Let’s Look at Some ZIPsBluebell (test API client)

http://open.pbs.org/lookup/localize_stations/

Goliat (API Explorer)http://open.pbs.org/explore/

Page 22: PBS Localization+ API Webinar

Questions? Feedback?Now is the time to ask questions and give your feedback.

Page 23: PBS Localization+ API Webinar

Fun ZIP Code20505

Page 24: PBS Localization+ API Webinar

More InformationDocumentation (in-progress):http://projects.pbs.org/confluence/display/localization/

Questions:http://answers.open.pbs.org/

GitHub Project Access:email: [email protected]

Comments and Suggestions:email: [email protected]