I'm trying to use the AlchemyAPI to run a sentiment analysis on a number of URLs. Because these URLs have their own set of parameters, I'm getting the data using HTTP.get
, then running Alchemy's HTMLGetTextSentiment
on the html that is returned:
getSentiment: (url) ->
html = HTTP.get url
res = HTTP.get "http://access.alchemyapi.com/calls/html/HTMLGetTextSentiment?html=#{html}&apikey=<key>&outputMode=json"
res
This all works perfectly... Except half the time it thinks the content is the wrong language and throws an error. I happen to know that 100% of these pages will contain only English-language content, so is there a way to bypass the language detector and hard-code the language into the request?