Renee's First IPython Notebook and First API Usage "In the Wild" (outside of a course)

Import the "requests" library and set up the parameters to pass in the request. We're going to create a list of the 10 most recent stories matching the search term "data science".


In [2]:
import requests 
#key-value pairs of parameters
p = {'searchTerm':'"data science"','numResults':'10'}
r = requests.get("http://api.npr.org/query?apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001", params=p)
#view the generated url with the parameters in the querystring (it's clickable to see the xml) and the 
#response status and content-type
print(r.url + '\nstatus:' + str(r.status_code) + '\ncontent-type:' + r.headers['content-type'])


http://api.npr.org/query?apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001&searchTerm=%22data+science%22&numResults=10
status:200
content-type:text/xml;charset=UTF-8

Parse the XML tree and loop through it.


In [18]:
import lxml.etree as etree
#parse the response xml
tree = etree.XML(r.content)

#iterate through the entire tree and display each item's tag and text
for item in tree:
    #separate the stories
    if item.tag == 'story':
        print('\n---------------------------------------------------------')
    #print everything under the story tag but the paragraphs and fullText (to save space)
    for subitems in item.iter("*"):
        if subitems.tag != 'paragraph' and subitems.tag != 'fullText':
            print(subitems.tag + ': ' + str(subitems.text))


list: 
    
title: NPR: Stories from NPR
teaser: Assorted stories from NPR
miniTeaser: Custom NPR News Feed API.  Visit http://www.npr.org/templates/apidoc/index.php for more information.
link: http://api.npr.org/query?searchTerm=%22data%20science%22&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
story: 
      
link: http://www.npr.org/sections/13.7/2015/03/24/395012901/what-if-web-search-results-were-based-on-accuracy?ft=nprml&f=
link: http://api.npr.org/query?id=395012901&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/1BKkKLc
title: What If Web Search Results Were Based On Accuracy?
subtitle: None
shortTitle: None
teaser: Google has been researching the possibility of ranking search results based on established facts. Were this to become the norm, it would have huge implications for future discourse, says Adam Frank.
miniTeaser: None
slug: 13.7: Cosmos And Culture
thumbnail: 
        
medium: http://media.npr.org/assets/img/2015/03/24/google_sq-6994360b215eb7bb08fafa418c6e742a90f1a600.jpg?s=13
large: http://media.npr.org/assets/img/2015/03/24/google_sq-6994360b215eb7bb08fafa418c6e742a90f1a600.jpg?s=11
provider: iStockphoto
storyDate: Tue, 24 Mar 2015 07:55:00 -0400
pubDate: Tue, 24 Mar 2015 13:24:00 -0400
lastModifiedDate: Tue, 31 Mar 2015 04:07:20 -0400
audioRunByDate: None
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
parent: 
        
title: Commentary
link: http://www.npr.org/sections/commentary/?ft=nprml&f=
link: http://api.npr.org/query?id=1060&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: civil society
link: http://www.npr.org/tags/395014619/civil-society?ft=nprml&f=
link: http://api.npr.org/query?id=395014619&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: accuracy
link: http://www.npr.org/tags/395014606/accuracy?ft=nprml&f=
link: http://api.npr.org/query?id=395014606&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: web search
link: http://www.npr.org/tags/395014604/web-search?ft=nprml&f=
link: http://api.npr.org/query?id=395014604&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: facts
link: http://www.npr.org/tags/395014602/facts?ft=nprml&f=
link: http://api.npr.org/query?id=395014602&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Culture
link: http://www.npr.org/sections/13.7/126355748/culture/?ft=nprml&f=
link: http://api.npr.org/query?id=126355748&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Google
link: http://www.npr.org/tags/125099562/google?ft=nprml&f=
link: http://api.npr.org/query?id=125099562&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: 13.7: Cosmos And Culture
link: http://www.npr.org/sections/13.7/?ft=nprml&f=
link: http://api.npr.org/query?id=114424647&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Commentary
link: http://www.npr.org/sections/commentary/?ft=nprml&f=
link: http://api.npr.org/query?id=1060&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Digital Life
link: http://www.npr.org/sections/digital-life/?ft=nprml&f=
link: http://api.npr.org/query?id=1049&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Business
link: http://www.npr.org/sections/business/?ft=nprml&f=
link: http://api.npr.org/query?id=1006&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Home Page Top Stories
link: http://www.npr.org/?ft=nprml&f=
link: http://api.npr.org/query?id=1002&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
byline: 
        
name: Adam Frank
link: http://www.npr.org/people/336050847/adam-frank?ft=nprml&f=
link: http://api.npr.org/query?id=336050847&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
image: 
        
title: Google search page.
caption: None
link: None
producer: Matjaz Boncina
provider: iStockphoto
copyright: None
enlargement: 
          
caption: None
crop: None
crop: None
crop: None
crop: None
text: 
        
textWithHtml: 
        
story: 
      
link: http://www.npr.org/sections/alltechconsidered/2015/03/23/394827451/now-algorithms-are-deciding-whom-to-hire-based-on-voice?ft=nprml&f=
link: http://api.npr.org/query?id=394827451&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/18T09hi
title: Now Algorithms Are Deciding Whom To Hire, Based On Voice
subtitle: None
shortTitle: None
teaser: If you're trying out for a job, the one judging you may not be a person — it could be a computer. Algorithms are evaluating human voices to determine which ones are engaging, calming and trustworthy.
miniTeaser: None
slug: All Tech Considered
thumbnail: 
        
medium: http://media.npr.org/assets/img/2015/03/23/gettyimages-106683221edit_sq-3f2aa467193d4740564c3d4e9b1041d9bbb134e6.jpg?s=13
large: http://media.npr.org/assets/img/2015/03/23/gettyimages-106683221edit_sq-3f2aa467193d4740564c3d4e9b1041d9bbb134e6.jpg?s=11
provider: Ikon Images/Getty Images
storyDate: Mon, 23 Mar 2015 16:40:00 -0400
pubDate: Wed, 27 May 2015 08:58:00 -0400
lastModifiedDate: Wed, 27 May 2015 08:58:41 -0400
audioRunByDate: Sat, 28 Mar 2015 01:00:00 -0400
show: 
        
program: All Things Considered
showDate: Mon, 23 Mar 2015 16:00:00 -0400
segNum: 9
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
transcript: 
        
link: http://api.npr.org/transcript?id=394827451&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Things Considered for March 23, 2015
link: http://www.npr.org/programs/all-things-considered/2015/03/23/394807955?ft=nprml&f=
link: http://api.npr.org/query?id=394807955&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Tech Considered Featured Post Two
link: http://www.npr.org/series/241677706/all-tech-considered-featured-post-two?ft=nprml&f=
link: http://api.npr.org/query?id=241677706&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Science
link: http://www.npr.org/sections/alltechconsidered/211399851/science?ft=nprml&f=
link: http://api.npr.org/query?id=211399851&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Innovation
link: http://www.npr.org/sections/alltechconsidered/195149875/innovation?ft=nprml&f=
link: http://api.npr.org/query?id=195149875&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: algorithms
link: http://www.npr.org/tags/177072836/algorithms?ft=nprml&f=
link: http://api.npr.org/query?id=177072836&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: speaking
link: http://www.npr.org/tags/135546516/speaking?ft=nprml&f=
link: http://api.npr.org/query?id=135546516&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Jobs
link: http://www.npr.org/tags/131777176/jobs?ft=nprml&f=
link: http://api.npr.org/query?id=131777176&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Tech Considered
link: http://www.npr.org/sections/alltechconsidered/?ft=nprml&f=
link: http://api.npr.org/query?id=102920358&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Story of the Day
link: http://www.npr.org/sections/story-of-the-day/?ft=nprml&f=
link: http://api.npr.org/query?id=1090&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Digital Life
link: http://www.npr.org/sections/digital-life/?ft=nprml&f=
link: http://api.npr.org/query?id=1049&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Business
link: http://www.npr.org/sections/business/?ft=nprml&f=
link: http://api.npr.org/query?id=1006&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Home Page Top Stories
link: http://www.npr.org/?ft=nprml&f=
link: http://api.npr.org/query?id=1002&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: News
link: http://www.npr.org/sections/news/?ft=nprml&f=
link: http://api.npr.org/query?id=1001&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Things Considered
link: http://www.npr.org/programs/all-things-considered/?ft=nprml&f=
link: http://api.npr.org/query?id=2&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
audio: 
        
title: None
duration: 267
description: None
format: 
          
mp3: http://api.npr.org/m3u/1394906629-e8c9fa.m3u?orgId=1&topicId=1019&d=267&p=2&story=394827451&t=progseg&e=394807955&seg=9&ft=nprml&f=
wm: http://www.npr.org/templates/dmg/dmg_wmref_em.php?id=394906629&type=1&mtype=WM&orgId=1&topicId=1019&d=267&p=2&story=394827451&t=progseg&e=394807955&seg=9&ft=nprml&f=
mp4: http://pd.npr.org/npr-mp4/npr/atc/2015/03/20150323_atc_now_algorithms_are_deciding_whom_to_hire_based_on_voice.mp4?orgId=1&topicId=1019&d=267&p=2&story=394827451&t=progseg&e=394807955&seg=9&ft=nprml&f=
mediastream: rtmp://flash.npr.org/ondemand/mp3:anon.npr-mp3/npr/atc/2015/03/20150323_atc_now_algorithms_are_deciding_whom_to_hire_based_on_voice.mp3
region: all
rightsHolder: None
permissions: 
          
download: None
stream: None
embed: None
stream: None
byline: 
        
name: Aarti Shahani
link: http://www.npr.org/people/348730771/aarti-shahani?ft=nprml&f=
link: http://api.npr.org/query?id=348730771&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
container: 
        
title: None
introText: None
colSpan: 1
displayOptions: Display Both
link: None
link: None
image: 
        
title: People talking together
caption: None
link: None
producer: Ilana Kohn
provider: Ikon Images/Getty Images
copyright: None
enlargement: 
          
caption: None
crop: None
crop: None
crop: None
crop: None
crop: None
relatedLink: 
        
caption:  Recruiting Better Talent With Brain Games And Big Data
link: http://www.npr.org/sections/alltechconsidered/2015/02/25/388698620/recruiting-better-talent-with-brain-games-and-big-data?ft=nprml&f=
link: http://api.npr.org/query?id=388698620&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  Can't Ask That? Some Job Interviewers Go To Social Media Instead
link: http://www.npr.org/sections/alltechconsidered/2014/04/11/301791749/cant-ask-that-some-job-interviewers-go-to-social-media-instead?ft=nprml&f=
link: http://api.npr.org/query?id=301791749&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  Got A Voice For Radio? The Algorithm Speaks
link: http://www.npr.org/sections/alltechconsidered/2015/05/26/409746236/got-a-voice-for-radio-the-algorithm-speaks?ft=nprml&f=
link: http://api.npr.org/query?id=409746236&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
text: 
        
textWithHtml: 
        
externalAsset: 
        
url: http://www.youtube.com/watch?v=WO4tIrjBDkk
oEmbed: http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch%3Fv%3DWO4tIrjBDkk
externalId: WO4tIrjBDkk
credit: None
parameters: None
caption: None
story: 
      
link: http://www.npr.org/sections/alltechconsidered/2014/11/28/367046864/a-data-analysts-blog-is-transforming-how-new-yorkers-see-their-city?ft=nprml&f=
link: http://api.npr.org/query?id=367046864&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/1rzV7cw
title: A Data Analyst's Blog Is Transforming How New Yorkers See Their City
subtitle: None
shortTitle: None
teaser: Ben Wellington tracked down two of the city's costliest parking spots and its leafiest neighborhoods, while pointing out questionable health grades for restaurants and odd charges for subway riders.
miniTeaser: None
slug: All Tech Considered
thumbnail: 
        
medium: http://media.npr.org/assets/img/2014/11/27/nycdata_ozy_2_sq-be521042e99495223668bd03066c62b13c25deaa.jpg?s=13
large: http://media.npr.org/assets/img/2014/11/27/nycdata_ozy_2_sq-be521042e99495223668bd03066c62b13c25deaa.jpg?s=11
provider: OZY
storyDate: Fri, 28 Nov 2014 08:03:00 -0500
pubDate: Mon, 01 Dec 2014 12:51:00 -0500
lastModifiedDate: Mon, 01 Dec 2014 12:51:19 -0500
audioRunByDate: None
keywords: None
priorityKeywords: None
organization: 
        
name: Ozy.com
website: http://www.ozy.com/
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Innovation
link: http://www.npr.org/sections/alltechconsidered/195149875/innovation?ft=nprml&f=
link: http://api.npr.org/query?id=195149875&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Big Data
link: http://www.npr.org/tags/161337202/big-data?ft=nprml&f=
link: http://api.npr.org/query?id=161337202&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: New York City
link: http://www.npr.org/tags/126926055/new-york-city?ft=nprml&f=
link: http://api.npr.org/query?id=126926055&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Tech Considered
link: http://www.npr.org/sections/alltechconsidered/?ft=nprml&f=
link: http://api.npr.org/query?id=102920358&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Around the Nation
link: http://www.npr.org/sections/around-the-nation/?ft=nprml&f=
link: http://api.npr.org/query?id=1091&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Home Page Top Stories
link: http://www.npr.org/?ft=nprml&f=
link: http://api.npr.org/query?id=1002&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
byline: 
        
name: Farah Halime
image: 
        
title: New York data blogger Ben Wellington sits next to a fire hydrant Sunday in Brooklyn, N.Y. His investigation into the city's parking ticket data found that two Lower Manhattan hydrants on consecutive blocks in Manhattan generated $55,000 a year for the city — off of cars that appeared to be parked legally.
caption: New York data blogger Ben Wellington sits next to a fire hydrant Sunday in Brooklyn, N.Y. His investigation into the city's parking ticket data found that two Lower Manhattan hydrants on consecutive blocks in Manhattan generated $55,000 a year for the city — off of cars that appeared to be parked legally.
link: None
producer: RIchard Villa
provider: OZY
copyright: None
enlargement: 
          
caption: None
crop: None
crop: None
crop: None
crop: None
image: 
        
title: Wellington stands in front of a Volkswagen bus Sunday in Brooklyn, N.Y.
caption: Wellington stands in front of a Volkswagen bus Sunday in Brooklyn, N.Y.
link: None
producer: RIchard Villa 
provider: OZY
copyright: None
enlargement: 
          
caption: None
crop: None
crop: None
crop: None
crop: None
relatedLink: 
        
caption:  When Cities Become Science, Where Does Art Fit In?
link: http://www.npr.org/sections/13.7/2014/07/26/334038347/when-cities-become-science-where-does-art-fit-in?ft=nprml&f=
link: http://api.npr.org/query?id=334038347&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  What Big Data Means For Big Cities
link: http://www.npr.org/sections/13.7/2013/05/31/187056297/what-big-data-means-for-big-cities?ft=nprml&f=
link: http://api.npr.org/query?id=187056297&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
text: 
        
textWithHtml: 
        
story: 
      
link: http://www.npr.org/2014/10/27/359233263/parties-compete-to-build-the-best-voter-turnout-machine?ft=nprml&f=
link: http://api.npr.org/query?id=359233263&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/1v2Y465
title: Parties Compete To Build The Best Voter-Turnout Machine
subtitle: None
shortTitle: None
teaser: A week ahead of Election Day, both parties are still scrambling to identify and turn out every one of their voters. These get-out-the-vote operations are as expensive and high-tech as every other bit of modern campaigning.
miniTeaser: None
slug: Politics
storyDate: Mon, 27 Oct 2014 04:36:00 -0400
pubDate: Mon, 27 Oct 2014 07:32:00 -0400
lastModifiedDate: Mon, 27 Oct 2014 06:27:22 -0400
audioRunByDate: Wed, 29 Oct 2014 01:00:00 -0400
show: 
        
program: Morning Edition
showDate: Mon, 27 Oct 2014 05:00:00 -0400
segNum: 1
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
transcript: 
        
link: http://api.npr.org/transcript?id=359233263&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Morning Edition for October 27, 2014
link: http://www.npr.org/programs/morning-edition/2014/10/27/359233262/morning-edition-for-october-27-2014?ft=nprml&f=
link: http://api.npr.org/query?id=359233262&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Politics
link: http://www.npr.org/sections/politics/?ft=nprml&f=
link: http://api.npr.org/query?id=1014&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Politics
link: http://www.npr.org/sections/politics/?ft=nprml&f=
link: http://api.npr.org/query?id=1014&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: U.S.
link: http://www.npr.org/sections/us/?ft=nprml&f=
link: http://api.npr.org/query?id=1003&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Morning Edition
link: http://www.npr.org/programs/morning-edition/?ft=nprml&f=
link: http://api.npr.org/query?id=3&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
audio: 
        
title: None
duration: 432
description: None
format: 
          
mp3: http://api.npr.org/m3u/1359233264-106fb3.m3u?orgId=1&topicId=1014&d=432&p=3&story=359233263&t=progseg&e=359233262&seg=1&ft=nprml&f=
wm: http://www.npr.org/templates/dmg/dmg_wmref_em.php?id=359233264&type=1&mtype=WM&orgId=1&topicId=1014&d=432&p=3&story=359233263&t=progseg&e=359233262&seg=1&ft=nprml&f=
mp4: http://pd.npr.org/npr-mp4/npr/me/2014/10/20141027_me_parties_compete_to_build_the_best_voter-turnout_machine.mp4?orgId=1&topicId=1014&d=432&p=3&story=359233263&t=progseg&e=359233262&seg=1&ft=nprml&f=
mediastream: rtmp://flash.npr.org/ondemand/mp3:anon.npr-mp3/npr/me/2014/10/20141027_me_parties_compete_to_build_the_best_voter-turnout_machine.mp3
region: all
rightsHolder: None
permissions: 
          
download: None
stream: None
embed: None
stream: None
byline: 
        
name: Mara Liasson
link: http://www.npr.org/people/1930401/mara-liasson?ft=nprml&f=
link: http://api.npr.org/query?id=1930401&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
text: 
        
textWithHtml: 
        
story: 
      
link: http://www.npr.org/2014/09/20/350155825/in-san-diego-a-bootcamp-for-data-junkies?ft=nprml&f=
link: http://api.npr.org/query?id=350155825&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/1wAA3pE
title: In San Diego, A Boot Camp For Data Junkies
subtitle: None
shortTitle: None
teaser: Natasha Balac runs a two-day boot camp out of the San Diego Supercomputer Center for people from all types of industries to learn the tools and algorithms to help them analyze data and spot patterns.
miniTeaser: None
slug: Technology
storyDate: Sat, 20 Sep 2014 16:55:00 -0400
pubDate: Mon, 22 Sep 2014 10:23:00 -0400
lastModifiedDate: Mon, 22 Sep 2014 10:23:24 -0400
audioRunByDate: Sat, 27 Sep 2014 01:00:00 -0400
show: 
        
program: All Things Considered
showDate: Sat, 20 Sep 2014 16:00:00 -0400
segNum: 7
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
transcript: 
        
link: http://api.npr.org/transcript?id=350155825&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Things Considered for September 20, 2014
link: http://www.npr.org/programs/all-things-considered/2014/09/20/350108710?ft=nprml&f=
link: http://api.npr.org/query?id=350108710&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Business
link: http://www.npr.org/sections/business/?ft=nprml&f=
link: http://api.npr.org/query?id=1006&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Things Considered
link: http://www.npr.org/programs/all-things-considered/?ft=nprml&f=
link: http://api.npr.org/query?id=2&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
audio: 
        
title: None
duration: 247
description: None
format: 
          
mp3: http://api.npr.org/m3u/1350155828-c6e491.m3u?orgId=1&topicId=1019&d=247&p=2&story=350155825&t=progseg&e=350108710&seg=7&ft=nprml&f=
wm: http://www.npr.org/templates/dmg/dmg_wmref_em.php?id=350155828&type=1&mtype=WM&orgId=1&topicId=1019&d=247&p=2&story=350155825&t=progseg&e=350108710&seg=7&ft=nprml&f=
mp4: http://pd.npr.org/npr-mp4/npr/atc/2014/09/20140920_atc_in_san_diego_a_bootcamp_for_data_junkies.mp4?orgId=1&topicId=1019&d=247&p=2&story=350155825&t=progseg&e=350108710&seg=7&ft=nprml&f=
mediastream: rtmp://flash.npr.org/ondemand/mp3:anon.npr-mp3/npr/atc/2014/09/20140920_atc_in_san_diego_a_bootcamp_for_data_junkies.mp3
region: all
rightsHolder: None
permissions: 
          
download: None
stream: None
embed: None
stream: None
text: 
        
textWithHtml: 
        
story: 
      
link: http://www.npr.org/2014/07/04/328373960/facebook-apologizes-for-manipulation-data-research-likely-to-go-on?ft=nprml&f=
link: http://api.npr.org/query?id=328373960&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/1vEzkSp
title: Facebook Apologizes For Manipulation; Data Research Likely To Go On
subtitle: None
shortTitle: None
teaser: A mood study that Facebook conducted on unwitting users has been criticized. Data science plays an integral role at Facebook — for bottom line reasons, and in collaboration with academic researchers.
miniTeaser: None
slug: Business
storyDate: Fri, 04 Jul 2014 05:05:00 -0400
pubDate: Fri, 04 Jul 2014 07:52:00 -0400
lastModifiedDate: Fri, 04 Jul 2014 05:07:28 -0400
audioRunByDate: None
show: 
        
program: Morning Edition
showDate: Fri, 04 Jul 2014 05:00:00 -0400
segNum: 4
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
transcript: 
        
link: http://api.npr.org/transcript?id=328373960&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Morning Edition for July 4, 2014
link: http://www.npr.org/programs/morning-edition/2014/07/04/328373945/morning-edition-for-july-4-2014?ft=nprml&f=
link: http://api.npr.org/query?id=328373945&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Research News
link: http://www.npr.org/sections/research-news/?ft=nprml&f=
link: http://api.npr.org/query?id=1024&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Business
link: http://www.npr.org/sections/business/?ft=nprml&f=
link: http://api.npr.org/query?id=1006&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Business
link: http://www.npr.org/sections/business/?ft=nprml&f=
link: http://api.npr.org/query?id=1006&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Morning Edition
link: http://www.npr.org/programs/morning-edition/?ft=nprml&f=
link: http://api.npr.org/query?id=3&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
audio: 
        
title: None
duration: 112
description: None
format: 
          
mp3: http://api.npr.org/m3u/1328373961-eb7891.m3u?orgId=1&topicId=1006&d=112&p=3&story=328373960&t=progseg&e=328373945&seg=4&ft=nprml&f=
wm: http://www.npr.org/templates/dmg/dmg_wmref_em.php?id=328373961&type=1&mtype=WM&orgId=1&topicId=1006&d=112&p=3&story=328373960&t=progseg&e=328373945&seg=4&ft=nprml&f=
mp4: http://pd.npr.org/npr-mp4/npr/me/2014/07/20140704_me_facebook_apologizes_for_manipulation_data_research_likely_to_go_on.mp4?orgId=1&topicId=1006&d=112&p=3&story=328373960&t=progseg&e=328373945&seg=4&ft=nprml&f=
mediastream: rtmp://flash.npr.org/ondemand/mp3:anon.npr-mp3/npr/me/2014/07/20140704_me_facebook_apologizes_for_manipulation_data_research_likely_to_go_on.mp3
region: all
rightsHolder: None
permissions: 
          
download: None
stream: None
embed: None
stream: None
byline: 
        
name: Aarti Shahani
link: http://www.npr.org/people/348730771/aarti-shahani?ft=nprml&f=
link: http://api.npr.org/query?id=348730771&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
text: 
        
textWithHtml: 
        
story: 
      
link: http://www.npr.org/2013/09/17/223356184/the-occupy-movement-at-two-many-voices-many-messages?ft=nprml&f=
link: http://api.npr.org/query?id=223356184&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/16gWKRy
title: The Occupy Movement At 2: Many Voices, Many Messages
subtitle: None
shortTitle: None
teaser: Demonstrators packed lower Manhattan on Tuesday, two years after the launch of the Occupy Wall Street movement. While Occupy's prominence has faded since becoming a household name in 2011, its supporters say the group's concerns have helped prompt a national conversation about income inequality.
miniTeaser: It's no longer a household name, but Occupy says it put income inequality on America's front burner.
slug: U.S.
thumbnail: 
        
medium: http://media.npr.org/assets/img/2013/09/17/180884256_sq-956764e94ecfa2b3515c28b6a34ed58e61533458.jpg?s=13
large: http://media.npr.org/assets/img/2013/09/17/180884256_sq-956764e94ecfa2b3515c28b6a34ed58e61533458.jpg?s=11
provider: Getty Images
storyDate: Tue, 17 Sep 2013 17:10:00 -0400
pubDate: Tue, 17 Sep 2013 18:31:00 -0400
lastModifiedDate: Tue, 17 Sep 2013 18:31:24 -0400
audioRunByDate: None
show: 
        
program: All Things Considered
showDate: Tue, 17 Sep 2013 15:00:00 -0400
segNum: 8
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
transcript: 
        
link: http://api.npr.org/transcript?id=223356184&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Things Considered for September 17, 2013
link: http://www.npr.org/programs/all-things-considered/2013/09/17/223381920/?ft=nprml&f=
link: http://api.npr.org/query?id=223381920&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Around the Nation
link: http://www.npr.org/sections/around-the-nation/?ft=nprml&f=
link: http://api.npr.org/query?id=1091&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Economy
link: http://www.npr.org/sections/economy/?ft=nprml&f=
link: http://api.npr.org/query?id=1017&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: U.S.
link: http://www.npr.org/sections/us/?ft=nprml&f=
link: http://api.npr.org/query?id=1003&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: U.S.
link: http://www.npr.org/sections/us/?ft=nprml&f=
link: http://api.npr.org/query?id=1003&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Home Page Top Stories
link: http://www.npr.org/?ft=nprml&f=
link: http://api.npr.org/query?id=1002&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: News
link: http://www.npr.org/sections/news/?ft=nprml&f=
link: http://api.npr.org/query?id=1001&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: All Things Considered
link: http://www.npr.org/programs/all-things-considered/?ft=nprml&f=
link: http://api.npr.org/query?id=2&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
audio: 
        
title: None
duration: 238
description: None
format: 
          
mp3: http://api.npr.org/m3u/1223472694-83d6af.m3u?orgId=1&topicId=1003&d=238&p=2&story=223356184&t=progseg&e=223381920&seg=8&ft=nprml&f=
wm: http://www.npr.org/templates/dmg/dmg_wmref_em.php?id=223472694&type=1&mtype=WM&orgId=1&topicId=1003&d=238&p=2&story=223356184&t=progseg&e=223381920&seg=8&ft=nprml&f=
mp4: http://pd.npr.org/npr-mp4/npr/atc/2013/09/20130917_atc_08.mp4?orgId=1&topicId=1003&d=238&p=2&story=223356184&t=progseg&e=223381920&seg=8&ft=nprml&f=
mediastream: rtmp://flash.npr.org/ondemand/mp3:anon.npr-mp3/npr/atc/2013/09/20130917_atc_08.mp3
region: all
rightsHolder: None
permissions: 
          
download: None
stream: None
embed: None
stream: None
byline: 
        
name: Margot Adler
link: http://api.npr.org/query?id=2100166&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
container: 
        
title: Related NPR Stories
introText: None
colSpan: 1
displayOptions: Display Both
link: None
link: None
link: None
image: 
        
title: Demonstrators congregate near the New York Stock Exchange on Tuesday. Numerous rallies and events were planned to mark the second anniversary of the Occupy Wall Street movement, which targets income inequality and financial greed.
caption: Demonstrators congregate near the New York Stock Exchange on Tuesday. Numerous rallies and events were planned to mark the second anniversary of the Occupy Wall Street movement, which targets income inequality and financial greed.
link: None
producer: Spencer Platt
provider: Getty Images
copyright: None
enlargement: 
          
caption: None
crop: None
crop: None
crop: None
crop: None
crop: None
relatedLink: 
        
caption:  Report Finds 'Widespread Human Rights Violations' In Policing Of Occupy Protests
link: http://www.npr.org/sections/thetwo-way/2012/07/25/157369699/reports-finds-widespread-human-rights-violations-in-policing-of-occupy-protests?ft=nprml&f=
link: http://api.npr.org/query?id=157369699&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  The 'Second Disaster': Making Well-Intentioned Donations Useful
link: http://www.npr.org/2013/01/12/169198037/the-second-disaster-making-good-intentions-useful?ft=nprml&f=
link: http://api.npr.org/query?id=169198037&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  Where The Mask Seen In Global Protests Is Made
link: http://www.npr.org/sections/parallels/2013/07/03/198387951/where-the-mask-seen-in-global-protests-is-made?ft=nprml&f=
link: http://api.npr.org/query?id=198387951&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
text: 
        
textWithHtml: 
        
story: 
      
link: http://www.npr.org/2013/06/21/193578367/calling-it-metadata-doesnt-make-surveillance-less-intrusive?ft=nprml&f=
link: http://api.npr.org/query?id=193578367&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/14jiPPb
title: Calling It 'Metadata' Doesn't Make Surveillance Less Intrusive
subtitle: None
shortTitle: None
teaser: Whether it's logs of phone calls or GPS data, commentator Geoff Nunberg says it still says a lot about who you are: "Tell me where you've been and who you've been talking to, and I'll tell you about your politics, your health, your sexual orientation, your finances," he says.
miniTeaser: Whether it's phone calls or GPS data, Geoff Nunberg says it still says a lot about who you are.
slug: Commentary
thumbnail: 
        
medium: http://media.npr.org/assets/img/2013/06/19/istock_000018865341large_sq-e9da0fee813fc2fba438fea3f0e5001e30cb4993.jpg?s=13
large: http://media.npr.org/assets/img/2013/06/19/istock_000018865341large_sq-e9da0fee813fc2fba438fea3f0e5001e30cb4993.jpg?s=11
provider: iStockphoto.com
storyDate: Fri, 21 Jun 2013 13:25:00 -0400
pubDate: Fri, 21 Jun 2013 14:47:00 -0400
lastModifiedDate: Thu, 12 Sep 2013 10:21:47 -0400
audioRunByDate: None
show: 
        
program: Fresh Air
showDate: Fri, 21 Jun 2013 11:00:00 -0400
segNum: 2
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
transcript: 
        
link: http://api.npr.org/transcript?id=193578367&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Commentary
link: http://www.npr.org/sections/commentary/?ft=nprml&f=
link: http://api.npr.org/query?id=1060&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Fresh Air for June 21, 2013
link: http://www.npr.org/programs/fresh-air/2013/06/21/193925921/?ft=nprml&f=
link: http://api.npr.org/query?id=193925921&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Fresh Air Reviews
link: http://www.npr.org/series/125638008/fresh-air-reviews?ft=nprml&f=
link: http://api.npr.org/query?id=125638008&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Commentary
link: http://www.npr.org/sections/commentary/?ft=nprml&f=
link: http://api.npr.org/query?id=1060&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Columns
link: http://www.npr.org/sections/columns/?ft=nprml&f=
link: http://api.npr.org/query?id=1058&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Opinion
link: http://www.npr.org/sections/opinion/?ft=nprml&f=
link: http://api.npr.org/query?id=1057&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Arts & Life
link: http://www.npr.org/sections/arts/?ft=nprml&f=
link: http://api.npr.org/query?id=1008&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Home Page Top Stories
link: http://www.npr.org/?ft=nprml&f=
link: http://api.npr.org/query?id=1002&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Fresh Air
link: http://www.npr.org/programs/fresh-air/?ft=nprml&f=
link: http://api.npr.org/query?id=13&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
audio: 
        
title: None
duration: 351
description: None
format: 
          
mp3: http://api.npr.org/m3u/1193954334-10056c.m3u?orgId=1&topicId=1060&d=351&p=13&story=193578367&t=progseg&e=193925921&seg=2&ft=nprml&f=
wm: http://www.npr.org/templates/dmg/dmg_wmref_em.php?id=193954334&type=1&mtype=WM&orgId=1&topicId=1060&d=351&p=13&story=193578367&t=progseg&e=193925921&seg=2&ft=nprml&f=
mp4: http://pd.npr.org/npr-mp4/npr/fa/2013/06/20130621_fa_02.mp4?orgId=1&topicId=1060&d=351&p=13&story=193578367&t=progseg&e=193925921&seg=2&ft=nprml&f=
mediastream: rtmp://flash.npr.org/ondemand/mp3:anon.npr-mp3/npr/fa/2013/06/20130621_fa_02.mp3
region: all
rightsHolder: None
permissions: 
          
download: None
stream: None
embed: None
stream: None
byline: 
        
name: Geoff Nunberg
link: http://www.npr.org/people/2101618/geoff-nunberg?ft=nprml&f=
link: http://api.npr.org/query?id=2101618&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
container: 
        
title: More From Geoff Nunberg
introText: None
colSpan: 1
displayOptions: Display Both
link: None
link: None
link: None
image: 
        
title: A card catalog
caption: None
link: None
producer: Andrey Kuzmin
provider: iStockphoto.com
copyright: None
enlargement: 
          
caption: None
crop: None
crop: None
crop: None
crop: None
relatedLink: 
        
caption:  Forget YOLO: Why 'Big Data' Should Be The Word Of The Year
link: http://www.npr.org/2012/12/20/167702665/geoff-nunbergs-word-of-the-year-big-data?ft=nprml&f=
link: http://api.npr.org/query?id=167702665&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  Even Dictionaries Grapple With Getting 'Marriage' Right
link: http://www.npr.org/2013/04/04/176235479/even-dictionaries-grapple-with-getting-marriage-right?ft=nprml&f=
link: http://api.npr.org/query?id=176235479&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  'Horrific' And 'Surreal': The Words We Use To Bear Witness
link: http://www.npr.org/2013/04/26/179021100/horrific-and-surreal-the-words-we-use-to-bear-witness?ft=nprml&f=
link: http://api.npr.org/query?id=179021100&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
pullQuote: 
        
text: Whether or not you think the government should be sweeping this stuff up, calling it metadata doesn't make the process any less intrusive. Tell me where you've been and who you've been talking to, and I'll tell you about your politics, your health, your sexual orientation, your finances. 
person: None
date: None
text: 
        
textWithHtml: 
        
story: 
      
link: http://www.npr.org/2013/03/24/174982423/former-bush-aide-pushes-conservative-case-for-gay-marriage?ft=nprml&f=
link: http://api.npr.org/query?id=174982423&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/YrQlSA
title: Former Bush Aide Pushes 'Conservative Case' For Gay Marriage
subtitle: None
shortTitle: None
teaser: Ken Mehlman, the political director for the George W. Bush White House, compares the right to marry to other fundamental rights conservatives embrace. He rounded up a group of 131 prominent Republicans to sign a legal brief that's at odds with the House GOP leadership and the party's platform.
miniTeaser: Ken Mehlman compares the right to marry to other fundamental rights conservatives embrace.
slug: Same-Sex Marriage And The Supreme Court
thumbnail: 
        
medium: http://media.npr.org/assets/img/2013/03/21/56633856_sq-abd9085b957eb2e00f61c6236663eb856c9e0654.jpg?s=13
large: http://media.npr.org/assets/img/2013/03/21/56633856_sq-abd9085b957eb2e00f61c6236663eb856c9e0654.jpg?s=11
provider: Getty Images
storyDate: Sun, 24 Mar 2013 06:05:00 -0400
pubDate: Sun, 24 Mar 2013 08:05:00 -0400
lastModifiedDate: Sun, 24 Mar 2013 18:46:54 -0400
audioRunByDate: None
show: 
        
program: Weekend Edition Sunday
showDate: Sun, 24 Mar 2013 08:00:00 -0400
segNum: 11
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
transcript: 
        
link: http://api.npr.org/transcript?id=174982423&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Weekend Edition Sunday for March 24, 2013
link: http://www.npr.org/programs/weekend-edition-sunday/2013/03/24/174983550/?ft=nprml&f=
link: http://api.npr.org/query?id=174983550&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Same-Sex Marriage And The Supreme Court
link: http://www.npr.org/series/174965583/same-sex-marriage-and-the-supreme-court?ft=nprml&f=
link: http://api.npr.org/query?id=174965583&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Law
link: http://www.npr.org/sections/law/?ft=nprml&f=
link: http://api.npr.org/query?id=1070&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Law
link: http://www.npr.org/sections/law/?ft=nprml&f=
link: http://api.npr.org/query?id=1070&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Politics
link: http://www.npr.org/sections/politics/?ft=nprml&f=
link: http://api.npr.org/query?id=1014&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: U.S.
link: http://www.npr.org/sections/us/?ft=nprml&f=
link: http://api.npr.org/query?id=1003&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Home Page Top Stories
link: http://www.npr.org/?ft=nprml&f=
link: http://api.npr.org/query?id=1002&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: News
link: http://www.npr.org/sections/news/?ft=nprml&f=
link: http://api.npr.org/query?id=1001&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Weekend Edition Sunday
link: http://www.npr.org/programs/weekend-edition-sunday/?ft=nprml&f=
link: http://api.npr.org/query?id=10&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
audio: 
        
title: None
duration: 306
description: None
format: 
          
mp3: http://api.npr.org/m3u/1175173098-1b63a1.m3u?orgId=1&topicId=1070&aggIds=174965583&d=306&p=10&story=174982423&t=progseg&e=174983550&seg=11&ft=nprml&f=
wm: http://www.npr.org/templates/dmg/dmg_wmref_em.php?id=175173098&type=1&mtype=WM&orgId=1&topicId=1070&aggIds=174965583&d=306&p=10&story=174982423&t=progseg&e=174983550&seg=11&ft=nprml&f=
mp4: http://pd.npr.org/npr-mp4/npr/wesun/2013/03/20130324_wesun_11.mp4?orgId=1&topicId=1070&aggIds=174965583&d=306&p=10&story=174982423&t=progseg&e=174983550&seg=11&ft=nprml&f=
mediastream: rtmp://flash.npr.org/ondemand/mp3:anon.npr-mp3/npr/wesun/2013/03/20130324_wesun_11.mp3
region: all
rightsHolder: None
permissions: 
          
download: None
stream: None
embed: None
stream: None
byline: 
        
name: Nina Totenberg
link: http://www.npr.org/people/2101289/nina-totenberg?ft=nprml&f=
link: http://api.npr.org/query?id=2101289&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
container: 
        
title: Related Stories
introText: None
colSpan: 2
displayOptions: Display Both
link: None
link: None
link: None
image: 
        
title: Ken Mehlman, then chairman of the Republican National Committee, speaks during a meeting at the Capitol Hilton in January 2006 in Washington, D.C.
caption: Ken Mehlman, then chairman of the Republican National Committee, speaks during a meeting at the Capitol Hilton in January 2006 in Washington, D.C.
link: None
producer: Chip Somodevilla
provider: Getty Images
copyright: None
enlargement: 
          
caption: None
crop: None
crop: None
crop: None
crop: None
relatedLink: 
        
caption:  Timeline: Gay Marriage In Law, Pop Culture And The Courts
link: http://www.npr.org/2013/03/21/174732431/timeline-gay-marriage-in-law-pop-culture-and-the-courts?ft=nprml&f=
link: http://api.npr.org/query?id=174732431&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  Meet The 83-Year-Old Taking On The U.S. Over Same-Sex Marriage
link: http://www.npr.org/2013/03/21/174944430/meet-the-83-year-old-taking-on-the-u-s-over-same-sex-marriage?ft=nprml&f=
link: http://api.npr.org/query?id=174944430&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
relatedLink: 
        
caption:  As Gay Marriage Heads To Court, A Look Back At The Bumpy Ride
link: http://www.npr.org/2013/03/21/174879832/as-gay-marriage-heads-to-court-a-look-back-at-the-bumpy-ride?ft=nprml&f=
link: http://api.npr.org/query?id=174879832&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
pullQuote: 
        
text: You can't change the past, but you can try to, as much as you can going forward, be helpful and be constructive.
person: Ken Mehlman
date: None
text: 
        
textWithHtml: 
        
story: 
      
link: http://www.npr.org/sections/13.7/2013/03/12/174028759/big-data-is-the-steam-engine-of-our-time?ft=nprml&f=
link: http://api.npr.org/query?id=174028759&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
link: http://n.pr/Y65cyZ
title: Big Data Is The Steam Engine Of Our Time
subtitle: None
shortTitle: None
teaser: Big Data is no flash in the pan. It's a revolution that will transform how we live. It's another in a long line of human attempts to bring order to the universe. As such, commentator Adam Frank also says it will change how we do science.
miniTeaser: Like it or not, Big Data is not going away. It's only going to get bigger (and bigger).
slug: 13.7: Cosmos And Culture
thumbnail: 
        
medium: http://media.npr.org/assets/img/2013/03/12/160313744-tokyo-stocks_sq-3ceba7291ac649b7c2de903e9272bc57db02da8b.jpg?s=13
large: http://media.npr.org/assets/img/2013/03/12/160313744-tokyo-stocks_sq-3ceba7291ac649b7c2de903e9272bc57db02da8b.jpg?s=11
provider: AFP/Getty Images
storyDate: Tue, 12 Mar 2013 12:28:00 -0400
pubDate: Sat, 13 Apr 2013 13:48:00 -0400
lastModifiedDate: Sat, 13 Apr 2013 13:47:59 -0400
audioRunByDate: None
keywords: None
priorityKeywords: None
organization: 
        
name: NPR
website: http://www.npr.org/
parent: 
        
title: Commentary
link: http://www.npr.org/sections/commentary/?ft=nprml&f=
link: http://api.npr.org/query?id=1060&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Emanuel Derman
link: http://www.npr.org/tags/174098122/emanuel-derman?ft=nprml&f=
link: http://api.npr.org/query?id=174098122&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Big Data
link: http://www.npr.org/tags/161337202/big-data?ft=nprml&f=
link: http://api.npr.org/query?id=161337202&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Culture
link: http://www.npr.org/sections/13.7/126355748/culture/?ft=nprml&f=
link: http://api.npr.org/query?id=126355748&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: 13.7: Cosmos And Culture
link: http://www.npr.org/sections/13.7/?ft=nprml&f=
link: http://api.npr.org/query?id=114424647&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Commentary
link: http://www.npr.org/sections/commentary/?ft=nprml&f=
link: http://api.npr.org/query?id=1060&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Opinion
link: http://www.npr.org/sections/opinion/?ft=nprml&f=
link: http://api.npr.org/query?id=1057&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Technology
link: http://www.npr.org/sections/technology/?ft=nprml&f=
link: http://api.npr.org/query?id=1019&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
parent: 
        
title: Home Page Top Stories
link: http://www.npr.org/?ft=nprml&f=
link: http://api.npr.org/query?id=1002&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
byline: 
        
name: Adam Frank
link: http://www.npr.org/people/336050847/adam-frank?ft=nprml&f=
link: http://api.npr.org/query?id=336050847&meta=inherit&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
image: 
        
title: Big Data: trying to make sense of the numbers
caption: Big Data: trying to make sense of the numbers
link: None
producer: Kazuhiro Nogi
provider: AFP/Getty Images
copyright: None
enlargement: 
          
caption: None
crop: None
crop: None
crop: None
crop: None
crop: None
relatedLink: 
        
caption:  Self-Tracking Apps To Help You 'Quantify' Yourself
link: http://www.npr.org/sections/alltechconsidered/2013/03/12/174058272/self-tracking-apps-to-help-you-quantify-yourself?ft=nprml&f=
link: http://api.npr.org/query?id=174058272&apiKey=MDE5Mzg3Mjc2MDE0MzMyMjM3NjM5ZTI2Ng001
text: 
        
textWithHtml: 
        

Now that we see how the output looks, we can format and print the output as we want it to appear.


In [28]:
import lxml.etree as etree
#parse the API response xml
tree = etree.XML(r.content)

#library to format the date later
from dateutil import parser as dtp

#define the list that the selected stories will go into
storylist = []
#find all of the elements in the tree that make up a story
#the story tag is 2 "layers" down into the tree
stories = [subitem for item in tree for subitem in item if subitem.tag=='story']
for story in stories:
    #define dictionary for story parts
    storypart = {}
    for element in story:
        #print(element.tag) #for testing
        if element.tag == 'title':
            storypart["title"] = element.text
        if element.tag == 'teaser':
            storypart["teaser"] = element.text
        if element.tag == 'link' and element.attrib['type'] == 'html':
            storypart["htmllink"] = element.text
        for subelement in element.iter("*"):
            if subelement.tag == 'program':
                storypart["program"] = subelement.text
            if subelement.tag == 'mp3':
                storypart["mp3link"] = subelement.text
            if subelement.tag == 'storyDate':
                dt = dtp.parse(subelement.text)
                storypart["date"] = dt.strftime("%x %I:%M%p")
    #print(storypart) #for testing
    #we're creating a list of dictionaries here
    storylist.append(storypart)
#format for display
#iterate through list of stories, then output items in each story's dictionary in desired display order
for story in storylist:
    #check to see if dict key exists, because not every story has every element
    #and error is thrown if you refer to nonexistent key
    if "title" in story:
        print("\n***** " + story["title"] + " *****")
    print()
    if "teaser" in story:
        print(story["teaser"],"\n")
    if "htmllink" in story:
        print ("Story Link: " + story["htmllink"]) 
    if "date" in story:
        print("Published: " + story["date"])
    if "program" in story:
        print("Program: " + story["program"])
    if "mp3link" in story:
        print("Download MP3: " + story["mp3link"])
    print("\n")


***** What If Web Search Results Were Based On Accuracy? *****

Google has been researching the possibility of ranking search results based on established facts. Were this to become the norm, it would have huge implications for future discourse, says Adam Frank. 

Story Link: http://www.npr.org/sections/13.7/2015/03/24/395012901/what-if-web-search-results-were-based-on-accuracy?ft=nprml&f=
Published: 03/24/15 07:55AM



***** Now Algorithms Are Deciding Whom To Hire, Based On Voice *****

If you're trying out for a job, the one judging you may not be a person — it could be a computer. Algorithms are evaluating human voices to determine which ones are engaging, calming and trustworthy. 

Story Link: http://www.npr.org/sections/alltechconsidered/2015/03/23/394827451/now-algorithms-are-deciding-whom-to-hire-based-on-voice?ft=nprml&f=
Published: 03/23/15 04:40PM
Program: All Things Considered
Download MP3: http://api.npr.org/m3u/1394906629-e8c9fa.m3u?orgId=1&topicId=1019&d=267&p=2&story=394827451&t=progseg&e=394807955&seg=9&ft=nprml&f=



***** A Data Analyst's Blog Is Transforming How New Yorkers See Their City *****

Ben Wellington tracked down two of the city's costliest parking spots and its leafiest neighborhoods, while pointing out questionable health grades for restaurants and odd charges for subway riders. 

Story Link: http://www.npr.org/sections/alltechconsidered/2014/11/28/367046864/a-data-analysts-blog-is-transforming-how-new-yorkers-see-their-city?ft=nprml&f=
Published: 11/28/14 08:03AM



***** Parties Compete To Build The Best Voter-Turnout Machine *****

A week ahead of Election Day, both parties are still scrambling to identify and turn out every one of their voters. These get-out-the-vote operations are as expensive and high-tech as every other bit of modern campaigning. 

Story Link: http://www.npr.org/2014/10/27/359233263/parties-compete-to-build-the-best-voter-turnout-machine?ft=nprml&f=
Published: 10/27/14 04:36AM
Program: Morning Edition
Download MP3: http://api.npr.org/m3u/1359233264-106fb3.m3u?orgId=1&topicId=1014&d=432&p=3&story=359233263&t=progseg&e=359233262&seg=1&ft=nprml&f=



***** In San Diego, A Boot Camp For Data Junkies *****

Natasha Balac runs a two-day boot camp out of the San Diego Supercomputer Center for people from all types of industries to learn the tools and algorithms to help them analyze data and spot patterns. 

Story Link: http://www.npr.org/2014/09/20/350155825/in-san-diego-a-bootcamp-for-data-junkies?ft=nprml&f=
Published: 09/20/14 04:55PM
Program: All Things Considered
Download MP3: http://api.npr.org/m3u/1350155828-c6e491.m3u?orgId=1&topicId=1019&d=247&p=2&story=350155825&t=progseg&e=350108710&seg=7&ft=nprml&f=



***** Facebook Apologizes For Manipulation; Data Research Likely To Go On *****

A mood study that Facebook conducted on unwitting users has been criticized. Data science plays an integral role at Facebook — for bottom line reasons, and in collaboration with academic researchers. 

Story Link: http://www.npr.org/2014/07/04/328373960/facebook-apologizes-for-manipulation-data-research-likely-to-go-on?ft=nprml&f=
Published: 07/04/14 05:05AM
Program: Morning Edition
Download MP3: http://api.npr.org/m3u/1328373961-eb7891.m3u?orgId=1&topicId=1006&d=112&p=3&story=328373960&t=progseg&e=328373945&seg=4&ft=nprml&f=



***** The Occupy Movement At 2: Many Voices, Many Messages *****

Demonstrators packed lower Manhattan on Tuesday, two years after the launch of the Occupy Wall Street movement. While Occupy's prominence has faded since becoming a household name in 2011, its supporters say the group's concerns have helped prompt a national conversation about income inequality. 

Story Link: http://www.npr.org/2013/09/17/223356184/the-occupy-movement-at-two-many-voices-many-messages?ft=nprml&f=
Published: 09/17/13 05:10PM
Program: All Things Considered
Download MP3: http://api.npr.org/m3u/1223472694-83d6af.m3u?orgId=1&topicId=1003&d=238&p=2&story=223356184&t=progseg&e=223381920&seg=8&ft=nprml&f=



***** Calling It 'Metadata' Doesn't Make Surveillance Less Intrusive *****

Whether it's logs of phone calls or GPS data, commentator Geoff Nunberg says it still says a lot about who you are: "Tell me where you've been and who you've been talking to, and I'll tell you about your politics, your health, your sexual orientation, your finances," he says. 

Story Link: http://www.npr.org/2013/06/21/193578367/calling-it-metadata-doesnt-make-surveillance-less-intrusive?ft=nprml&f=
Published: 06/21/13 01:25PM
Program: Fresh Air
Download MP3: http://api.npr.org/m3u/1193954334-10056c.m3u?orgId=1&topicId=1060&d=351&p=13&story=193578367&t=progseg&e=193925921&seg=2&ft=nprml&f=



***** Former Bush Aide Pushes 'Conservative Case' For Gay Marriage *****

Ken Mehlman, the political director for the George W. Bush White House, compares the right to marry to other fundamental rights conservatives embrace. He rounded up a group of 131 prominent Republicans to sign a legal brief that's at odds with the House GOP leadership and the party's platform. 

Story Link: http://www.npr.org/2013/03/24/174982423/former-bush-aide-pushes-conservative-case-for-gay-marriage?ft=nprml&f=
Published: 03/24/13 06:05AM
Program: Weekend Edition Sunday
Download MP3: http://api.npr.org/m3u/1175173098-1b63a1.m3u?orgId=1&topicId=1070&aggIds=174965583&d=306&p=10&story=174982423&t=progseg&e=174983550&seg=11&ft=nprml&f=



***** Big Data Is The Steam Engine Of Our Time *****

Big Data is no flash in the pan. It's a revolution that will transform how we live. It's another in a long line of human attempts to bring order to the universe. As such, commentator Adam Frank also says it will change how we do science. 

Story Link: http://www.npr.org/sections/13.7/2013/03/12/174028759/big-data-is-the-steam-engine-of-our-time?ft=nprml&f=
Published: 03/12/13 12:28PM



In [ ]: