Assignment 9

The Library Jsonlite already offers an interface to set the Json object and format it as data frame, also after getting the API key from new york times and exploring the documentation, I’m lucky to know that only a GET call with the API key as parameter will be enough to fetch results. Other API key only support other types of messages as POST or the API key needs to go attached as part of the header message, but not this one (I believe there must be methods inside the jsonlite library to work with these APIs as well)

mostviewed <- fromJSON('https://api.nytimes.com/svc/mostpopular/v2/mostviewed/Arts/7.json?api_key=30667620d6b14b0fb6a83e32f9fc186b')

displayResults <- mostviewed$results[,6:8]
kable(displayResults)
type title abstract
Article Leon Wieseltier Admits ‘Offenses’ Against Female Colleagues as New Magazine Is Killed The former literary editor of the New Republic said he was “ashamed to know that I made any of them feel demeaned and disrespected.”
Article Playboy to Feature Its First Transgender Playmate Although Ines Rau will be the first transgender Playmate, Playboy has featured transgender women before. Cooper Hefner said the move fit with the brand’s philosophy.
Article John Mayer Knows He Messed Up. He Wants Another Chance. After more than five years of self-imposed pop exile, this guitar virtuoso wants another blockbuster album. Then he hopes to settle down.
Article After a Late Start, an Artist’s Big Break: Michelle Obama’s Official Portrait Amy Sherald has yet to start the Obama portrait, due by year’s end. If she seems calm, it’s likely because she has faced tougher challenges.
Article The Playlist: Taylor Swift Has a Miserable Crush and 12 More New Songs Hear the tracks the caught our critics’ attention this week, from Fever Ray, Colleen, Chris Stapleton and more.
Article Review: ‘Star Trek: Discovery’ Slowly Goes Where Dark TV Has Gone Before Through its first five episodes, this moody series has some good ideas as it tries to adapt the franchise to the times. But it could use an energy boost.
Article Seth Meyers Is Not Impressed by Jeff Flake’s Trump Takedown On “Late Night,” Mr. Meyers criticized Senator Flake of Arizona for voting to confirm certain members of the president’s cabinet.
Article ‘Outlander’ Season 3, Episode 6: Time Doesn’t Matter Expectations were high for Claire and Jamie’s reunion. So how did it go?
Article A Remnant From Caligula’s Ship, Once a Coffee Table, Heads Home Investigators in Manhattan seized the mosaic from the home of a collector, asserting that it had been looted from Italy decades ago.
Article An Auction Setup at Christie’s: First a Marathon, Then a Sprint Go behind the scenes at Christie’s New York as workers prepare for the Fine Chinese Ceramics and Works of Art auction with goods worth millions of dollars.
Article Obama Letters From 1980s Are Obtained by Emory University Nine letters from Barack Obama to his college girlfriend, Alexandra McNear, will be available to the public at Emory’s Stuart A. Rose library.
Article Trevor Noah Isn’t Surprised That Trump Offended a Fallen Soldier’s Widow Mr. Noah said, “I don’t think we should be surprised that Trump offended this family. We’ve all heard him speak: We’re offended every day.”
Article Gord Downie, a Canadian Rock Legend, Sings Goodbye Inside the making of “Introduce Yerself,” the intimate new solo album that the Tragically Hip frontman made before his death this week.
Article Sculpture Too Sexual for the Louvre to Be Shown at Pompidou Center After prompting questions about freedom of expression, the 40-foot-tall “Domestikator” installation is now poised to go on display in Paris.
Article A Trove of Yiddish Artifacts Rescued From the Nazis, and Oblivion Hidden in a church basement and forgotten, the books and documents recently discovered provide sharp new insights into Jewish life and literature.
Article Review: ‘Stranger Things’ Returns, More Familiar but Still Fun Did last year’s surprise nostalgia phenomenon need a sequel? Not really, but we’ll take it anyway.
Article Trevor Noah Defends Florida Congresswoman Attacked by John Kelly Mr. Noah said that after a tape seemed to disprove Mr. Kelly’s account of a speech by Representative Frederica Wilson, she was owed an apology.
Article Jimmy Fallon Skeptical G.O.P. Senators Gave Trump Standing Ovation Mr. Fallon clarified the president’s boast on “The Tonight Show”: “They were mostly people getting up to leave, but still, that counts as a standing ovation.”
Article The Newseum Is Increasingly Relevant, but Can It Survive? The institution that celebrates journalism is now reckoning with years of financial deficits, partly caused by a news industry in turmoil.
Article Fats Domino Songs: Listen to 12 Essential Tracks His easygoing image concealed the boldness and subtlety of his music — Domino was an innovator who didn’t flaunt it. A dozen songs from his prime years prove it.

with the number ‘7’ at the end of the request, I only get the results from the last 7 days.

I won’t display the whole table for legibility issues. but the data is there.