It's a find-a-movie challenge
Bash, 182 bytes
curl "https://www.rottentomatoes.com/api/private/v2.0/browse?minTomato=$2&maxTomato=$2&type=dvd-streaming-all" 2>/dev/null|grep -o "{[^}]*aRating\":\"$1\""|grep -Po 'title":"\K[^"]*'
Usage:
$ bash script PG 98
The Island President
Inside Out
Zootopia
Paddington
Love & Friendship
Long Way North (Tout en haut du monde)
JavaScript (ES6), 167 162 159 bytes
Needs to be run from the root of rottentomatoes.com. Returns a Promise
object containing the title.
s=>n=>fetch(`api/private/v2.0/browse?minTomato=${n}&maxTomato=${n}&type=dvd-streaming-all`).then(r=>r.json()).then(j=>j.results.find(x=>x.mpaaRating==s).title)
If we can require that it be run in a specific directory then it becomes 139 bytes:
s=>n=>fetch(`browse?minTomato=${n}&maxTomato=${n}&type=dvd-streaming-all`).then(r=>r.json()).then(j=>j.results.find(x=>x.mpaaRating==s).title)
Python 2 + requests, 209 204 bytes
-5 bytes thanks to Ian Gödel.
lambda r,t:[i['title']for i in get('http://rottentomatoes.com/api/private/v2.0/browse?minTomato=%d&maxTomato=%d&type=dvd-streaming-all'%(t,t)).json()['results']if i['mpaaRating']==r]
from requests import*