library(tidyverse)
## Warning: package 'tidyverse' was built under R version 3.5.3
## -- Attaching packages ------------------------------------------------------------------------ tidyverse 1.2.1 --
## v ggplot2 3.1.1 v purrr 0.3.1
## v tibble 2.0.1 v dplyr 0.8.0.1
## v tidyr 0.8.3 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.4.0
## Warning: package 'ggplot2' was built under R version 3.5.3
## Warning: package 'readr' was built under R version 3.5.3
## Warning: package 'forcats' was built under R version 3.5.3
## -- Conflicts --------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(jsonlite)
## Warning: package 'jsonlite' was built under R version 3.5.3
##
## Attaching package: 'jsonlite'
## The following object is masked from 'package:purrr':
##
## flatten
library(knitr)
## Warning: package 'knitr' was built under R version 3.5.3
library(dplyr)
library(httr)
## Warning: package 'httr' was built under R version 3.5.3
library(rjson)
##
## Attaching package: 'rjson'
## The following objects are masked from 'package:jsonlite':
##
## fromJSON, toJSON
library(stringi)
my_key = "VyfZDT2zI2fvSp2OyKogKtzD6HrmTu5l"
df <- jsonlite::fromJSON(txt = paste0("https://api.nytimes.com/svc/movies/v2/reviews/all.json?api-key=", my_key)) %>%
data.frame
df %>%
head()
## status
## 1 OK
## 2 OK
## 3 OK
## 4 OK
## 5 OK
## 6 OK
## copyright
## 1 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 2 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 3 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 4 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 5 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 6 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## has_more num_results results.display_title
## 1 TRUE 20 Synonyms
## 2 TRUE 20 Black and Blue
## 3 TRUE 20 Western Stars
## 4 TRUE 20 Making Waves: The Art of Cinematic Sound
## 5 TRUE 20 Burning Cane
## 6 TRUE 20 The Kill Team
## results.mpaa_rating results.critics_pick results.byline
## 1 1 MANOHLA DARGIS
## 2 R 1 A.O. SCOTT
## 3 PG 1 KEN JAWOROWSKI
## 4 1 GLENN KENNY
## 5 1 GLENN KENNY
## 6 R 0 BEN KENIGSBERG
## results.headline
## 1 Synonyms Review: Brilliant. Relentless. Comic. Tragic.
## 2 Black and Blue Review: A Cop Thriller for Our Age of Dread
## 3 Western Stars Review: Bruce Springsteen and Broken Cowboys
## 4 Making Waves Review: How Sound in Cinema Moves Us
## 5 Burning Cane Review: Poverty and Despair in Rural Louisiana
## 6 The Kill Team Review: Bullying on the Battlefield
## results.summary_short
## 1 In this scorching movie from Nadav Lapid, a young Israeli flees to Paris and tries to transform into a Frenchman. It goes badly.
## 2 Naomie Harris plays a rookie running from bad police officers and drug dealers in Deon Taylors violent, astute film.
## 3 This concert film, directed by the singer and Thom Zimny, puts Bruce in a barn with an orchestra to make some magic.
## 4 A documentary provides vivid examples of the power of audio in a motion picture.
## 5 The director Phillip Youmans completed this, his first feature, while still in his teens. It feels like the work of an older, and fully formed, artist.
## 6 Alexander Skarsgard stars in a film based on the murders of Afghan civilians by American soldiers nearly a decade ago.
## results.publication_date results.opening_date results.date_updated
## 1 2019-10-24 2019-10-25 2019-10-27 16:44:22
## 2 2019-10-24 2019-10-25 2019-10-27 16:44:22
## 3 2019-10-24 2019-10-25 2019-10-27 16:44:21
## 4 2019-10-24 2019-10-25 2019-10-27 16:44:21
## 5 2019-10-24 2019-10-25 2019-10-27 16:44:20
## 6 2019-10-24 2019-10-25 2019-10-24 17:56:02
## results.link.type
## 1 article
## 2 article
## 3 article
## 4 article
## 5 article
## 6 article
## results.link.url
## 1 http://www.nytimes.com/2019/10/24/movies/synonyms-review.html
## 2 http://www.nytimes.com/2019/10/24/movies/black-and-blue-review.html
## 3 http://www.nytimes.com/2019/10/24/movies/western-stars-review.html
## 4 http://www.nytimes.com/2019/10/24/movies/making-waves-the-art-of-cinematic-sound-review.html
## 5 http://www.nytimes.com/2019/10/24/movies/burning-cane-review.html
## 6 http://www.nytimes.com/2019/10/24/movies/the-kill-team-review.html
## results.link.suggested_link_text
## 1 Read the New York Times Review of Synonyms
## 2 Read the New York Times Review of Black and Blue
## 3 Read the New York Times Review of Western Stars
## 4 Read the New York Times Review of Making Waves: The Art of Cinematic Sound
## 5 Read the New York Times Review of Burning Cane
## 6 Read the New York Times Review of The Kill Team
## results.multimedia.type
## 1 mediumThreeByTwo210
## 2 mediumThreeByTwo210
## 3 mediumThreeByTwo210
## 4 mediumThreeByTwo210
## 5 mediumThreeByTwo210
## 6 mediumThreeByTwo210
## results.multimedia.src
## 1 https://static01.nyt.com/images/2019/10/24/arts/24synonyms/merlin_162980427_b8788cef-d2c4-4e28-a9a5-7a2f1539577a-mediumThreeByTwo210.jpg
## 2 https://static01.nyt.com/images/2019/10/25/arts/24blackandblue/merlin_162979524_8fe68107-5e63-4c42-aab1-e951f9dde0e7-mediumThreeByTwo210.jpg
## 3 https://static01.nyt.com/images/2019/10/24/arts/western1/merlin_162980691_01b11a6f-d4c0-48de-a1a3-bb081a6082d5-mediumThreeByTwo210.jpg
## 4 https://static01.nyt.com/images/2019/10/25/arts/24makingwaves/24makingwaves-mediumThreeByTwo210.jpg
## 5 https://static01.nyt.com/images/2019/10/25/arts/24burning/merlin_162979698_0fef3cbf-1f57-4374-a5d4-8da952532c16-mediumThreeByTwo210.jpg
## 6 https://static01.nyt.com/images/2019/10/24/arts/24killteam/merlin_162980196_c2a146f1-5a88-4e2e-bec6-19dfd36fa254-mediumThreeByTwo210.jpg
## results.multimedia.width results.multimedia.height
## 1 210 140
## 2 210 140
## 3 210 140
## 4 210 140
## 5 210 140
## 6 210 140
colnames(df)
## [1] "status" "copyright"
## [3] "has_more" "num_results"
## [5] "results.display_title" "results.mpaa_rating"
## [7] "results.critics_pick" "results.byline"
## [9] "results.headline" "results.summary_short"
## [11] "results.publication_date" "results.opening_date"
## [13] "results.date_updated" "results.link"
## [15] "results.multimedia"
kable(names(df$results.link), format="markdown")
x |
---|
type |
url |
suggested_link_text |
nrow(df)
## [1] 20
all <- cbind(df[1:9], df$results.link$type, df$results.link$url,df$results.link$suggested_link_text)
kable(head(all), format="markdown")
status | copyright | has_more | num_results | results.display_title | results.mpaa_rating | results.critics_pick | results.byline | results.headline | df\(results.link\)type | df\(results.link\)url | df\(results.link\)suggested_link_text |
---|---|---|---|---|---|---|---|---|---|---|---|
OK | Copyright (c) 2019 The New York Times Company. All Rights Reserved. | TRUE | 20 | Synonyms | 1 | MANOHLA DARGIS | ‘Synonyms’ Review: Brilliant. Relentless. Comic. Tragic. | article | http://www.nytimes.com/2019/10/24/movies/synonyms-review.html | Read the New York Times Review of Synonyms | |
OK | Copyright (c) 2019 The New York Times Company. All Rights Reserved. | TRUE | 20 | Black and Blue | R | 1 | A.O. SCOTT | ‘Black and Blue’ Review: A Cop Thriller for Our Age of Dread | article | http://www.nytimes.com/2019/10/24/movies/black-and-blue-review.html | Read the New York Times Review of Black and Blue |
OK | Copyright (c) 2019 The New York Times Company. All Rights Reserved. | TRUE | 20 | Western Stars | PG | 1 | KEN JAWOROWSKI | ‘Western Stars’ Review: Bruce Springsteen and Broken Cowboys | article | http://www.nytimes.com/2019/10/24/movies/western-stars-review.html | Read the New York Times Review of Western Stars |
OK | Copyright (c) 2019 The New York Times Company. All Rights Reserved. | TRUE | 20 | Making Waves: The Art of Cinematic Sound | 1 | GLENN KENNY | ‘Making Waves’ Review: How Sound in Cinema Moves Us | article | http://www.nytimes.com/2019/10/24/movies/making-waves-the-art-of-cinematic-sound-review.html | Read the New York Times Review of Making Waves: The Art of Cinematic Sound | |
OK | Copyright (c) 2019 The New York Times Company. All Rights Reserved. | TRUE | 20 | Burning Cane | 1 | GLENN KENNY | ‘Burning Cane’ Review: Poverty and Despair in Rural Louisiana | article | http://www.nytimes.com/2019/10/24/movies/burning-cane-review.html | Read the New York Times Review of Burning Cane | |
OK | Copyright (c) 2019 The New York Times Company. All Rights Reserved. | TRUE | 20 | The Kill Team | R | 0 | BEN KENIGSBERG | ‘The Kill Team’ Review: Bullying on the Battlefield | article | http://www.nytimes.com/2019/10/24/movies/the-kill-team-review.html | Read the New York Times Review of The Kill Team |
friendly_display <- cbind(df[c(5,8,9,10,12)], df$results.link$url)
kable(friendly_display, format="markdown")
results.display_title | results.byline | results.headline | results.summary_short | results.opening_date | df\(results.link\)url |
---|---|---|---|---|---|
Synonyms | MANOHLA DARGIS | ‘Synonyms’ Review: Brilliant. Relentless. Comic. Tragic. | In this scorching movie from Nadav Lapid, a young Israeli flees to Paris and tries to transform into a Frenchman. It goes badly. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/synonyms-review.html |
Black and Blue | A.O. SCOTT | ‘Black and Blue’ Review: A Cop Thriller for Our Age of Dread | Naomie Harris plays a rookie running from bad police officers and drug dealers in Deon Taylors violent, astute film. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/black-and-blue-review.html |
Western Stars | KEN JAWOROWSKI | ‘Western Stars’ Review: Bruce Springsteen and Broken Cowboys | This concert film, directed by the singer and Thom Zimny, puts Bruce in a barn with an orchestra to make some magic. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/western-stars-review.html |
Making Waves: The Art of Cinematic Sound | GLENN KENNY | ‘Making Waves’ Review: How Sound in Cinema Moves Us | A documentary provides vivid examples of the power of audio in a motion picture. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/making-waves-the-art-of-cinematic-sound-review.html |
Burning Cane | GLENN KENNY | ‘Burning Cane’ Review: Poverty and Despair in Rural Louisiana | The director Phillip Youmans completed this, his first feature, while still in his teens. It feels like the work of an older, and fully formed, artist. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/burning-cane-review.html |
The Kill Team | BEN KENIGSBERG | ‘The Kill Team’ Review: Bullying on the Battlefield | Alexander Skarsgard stars in a film based on the murders of Afghan civilians by American soldiers nearly a decade ago. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/the-kill-team-review.html |
Farming | BEN KENIGSBERG | ‘Farming’ Review: A Young Life of Self-Loathing | Adewale Akinnuoye-Agbaje looks at the impact of a British system that placed the children of African immigrants with Caucasian foster families. | NA | http://www.nytimes.com/2019/10/24/movies/farming-review.html |
The Great Alaskan Race | TEO BUGBEE | ‘The Great Alaskan Race’ Review: A Historic Sled Rescue Turned to Mush | Brian Presleys film squanders the dramatic ingredients of the early-20th-century sledding adventure its based on. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/the-great-alaskan-race-review.html |
Portals | BEN KENIGSBERG | ‘Portals’ Review: Snoozing Through Another Dimension | In this science fiction anthology, encounters with interdimensional beings prove to be a complete a waste of time. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/portals-review.html |
The Gallows Act II | GLENN KENNY | ‘The Gallows Act II’ Review: The Plays the Thing (That Kills) | Life gets a bit too dramatic for a high school drama student in this horror film. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/the-gallows-act-two-review.html |
The Current War: Director’s Cut | KEN JAWOROWSKI | ‘The Current War’ Review: Edison vs. Westinghouse, Down to the Wire | The film, which follows the race to bring electricity to American cities, stars Benedict Cumberbatch and Michael Shannon. | 2019-10-25 | http://www.nytimes.com/2019/10/24/movies/the-current-war-review.html |
Paradise Hills | MANOHLA DARGIS | ‘Paradise Hills’ Review: Caged Birds Singing, Maybe Escaping | In this dystopian tale, a private treatment center turns privileged young women into smilingly compliant stereotypes. | 2019-10-25 | http://www.nytimes.com/2019/10/23/movies/paradise-hills-review.html |
Frankie | A.O. SCOTT | ‘Frankie’ Review: Troubled in Paradise | Isabelle Huppert leads an impressive cast on a glum trip in Ira Sachss new film. | 2019-10-25 | http://www.nytimes.com/2019/10/23/movies/frankie-review.html |
The Elephant Queen | KEN JAWOROWSKI | ‘The Elephant Queen’ Review: Magnificent Images of Majestic Animals | In footage shot over several years, this documentary follows a herd of elephants across the Kenyan savanna. | NA | http://www.nytimes.com/2019/10/17/movies/the-elephant-queen-review.html |
By the Grace of God | GLENN KENNY | ‘By the Grace of God’ Review: A Devastating Film About Survivors of Abuse | The often irreverent French director François Ozon gets serious with a fact-based story about a group of men who were childhood victims of a pedophile priest. | 2019-10-18 | http://www.nytimes.com/2019/10/17/movies/by-the-grace-of-god-review.html |
The Cave | BEN KENIGSBERG | ‘The Cave’ Review: Do No Harm, for as Long as Possible | Feras Fayyads new documentary takes viewers into a subterranean Syrian hospital, as warplanes rumble overhead and bombings rattle the walls. | 2019-10-18 | http://www.nytimes.com/2019/10/17/movies/the-cave-review.html |
Wounds | HELEN T. VERONGOS | ‘Wounds’ Review: He Sees Dead People | Armie Hammer plays a New Orleans bartender who quickly loses his friendly veneer when a spooky cellphone takes over his life. | 2019-10-18 | http://www.nytimes.com/2019/10/17/movies/wounds-review.html |
Jojo Rabbit | A.O. SCOTT | ‘Jojo Rabbit’ Review: The Third Reich Wasnt All Fun and Games | Taika Waititis new film mixes farce, fantasy and drama in a Nazi-era coming-of-age story. | 2019-10-18 | http://www.nytimes.com/2019/10/17/movies/jojo-rabbit-review.html |
Kinetta | BEN KENIGSBERG | ‘Kinetta’ Review: Cryptic Seeds of Yorgos Lanthimoss Imagery | Set around a Greek seaside resort, the now-acclaimed directors 2005 movie bears inklings of ideas he would explore more fully later. | 2019-10-18 | http://www.nytimes.com/2019/10/17/movies/kinetta-review.html |
Maleficent: Mistress of Evil | MANOHLA DARGIS | ‘Maleficent: Mistress of Evil’ Review: Sleep, Sleep, My Lovelies | Angelina Jolie returns as the powerful, dangerous fairy in this tame, disappointing follow-up to the 2014 revisionist hit. | 2019-10-18 | http://www.nytimes.com/2019/10/17/movies/maleficent-mistress-of-evil-review.html |