javascript - First time using an API: How do I construct a request for the proper data from a quote API? Links included -
i using api stands4 quotes. able build random quote generator free code camp using random tag in request. want know how write request quote tv show personal project working on. know how possible?
here api doc: link
in particular looking @ second , third lines of request parameters table. want use 'search' don't know how produce correct 'query'. maybe going wrong.
here show quotes from: link
here tried. goal random quote show.
http://www.stands4.com/services/v2/quotes.php?uid=myuid&tokenid=mytokenid&searchtype=random&search&query=its+always+sunny+in+philadelphia
unfortunately, these aren't greatest docs you'll have play around "query=" part of search. you're correct in thinking that's start.
here's approach take make work:
1. searchtype=search: start subbing in sorts of different things it's sunny , seeing gets returned, including: character names, show name, writer/actor names, , if else fails show objects ("paddy's pub" , "day man") come mind. note: things spaces make sure you're using url-encoding.
2. searchtype=author: take writer names , maybe character names see if putting in author search type returns anything.
3. use scripts api: i'd hope come that, if doesn't work, can try , find scripts scripts api , parse them.
if else fails can use scraping tool import.io , grab quotes site imdb. import.io free , easy use.
Comments
Post a Comment