How to automatically expand contents on a JSON web page?

0

I use QuoDB to find useful examples from movie scripts. It seems like a JSON web page and I'm looking for a way to get the results expanded without having to click on every "context" button. Is there a way like entering a JavaScript code on the address bar or maybe finding out a URL parameter which can make those results expanded?

dashakol

Posted 2019-05-22T02:47:02.933

Reputation: 11

Answers

0

The easiest way for me to do it is right click > inspect element > select the "Network" tab > highlight the "XHR" filter > Reload the page. You will now be able to see all the API calls that come through.

EDIT

If you download an application called POSTMAN you can use it to do GET requests.

Search API: http://api.quodb.com/search/"ENTER SEARCH HERE"?titles_per_page=5&phrases_per_title=5&page=1

And if you want to get the context you can the results for the search API to get quotes by using the "title_id" and the "phrase_id" like so: http://api.quodb.com/quotes/title_id/phrase_id

Tom Dickson

Posted 2019-05-22T02:47:02.933

Reputation: 101

Thanks, but I'm not that technical. Can you give me a url template for that site which I can replace my searches in that url and get the results with expanded context? Besides, I followed the steps and found something like this when I click on the context http://api.quodb.com/quotes/M1295236bf/12592019 I put that in the address bar but it returns some gibberish text.

– dashakol – 2019-05-24T16:08:50.507

If you read my answer and give it a go, you will understand this is not a technical process. It is very simple to do. – Tom Dickson – 2019-05-28T06:28:05.257

The closest thing I get was the url template which I gave in the above comment. There is two problem:

  1. I load that url from address bar, but the text is not usable.
  2. You need to find out all the "title_id" and the "phrase_id" one by one.

I'm looking for a way to load all the context for a search at once. You said it's simple, I'll be very much appreciated if you could screen cast doing that and share it here too. – dashakol – 2019-05-31T12:00:26.307