Zirak / SO-ChatBot

Other
124 stars 62 forks source link

!!urban broken #276

Closed rlemon closed 8 years ago

rlemon commented 8 years ago

run !!urban poop and bot "returns" this:

08:47:16.402 /urban input isNaN1 master.js:5806:9 08:47:16.402 poop 0 /urban input1 master.js:5817:5 SyntaxError: unterminated string literal

Zirak commented 8 years ago

It's an intermittent problem with Urban Dictionary's API. Currently, this query is ended with:

[snip] "example":"Jessica really educated me on the concept of white privilege after she got arrested for protesting the gentrification of Harlem. She's a real SJW.","thumbs_down":4211}],"sounds":["http://wav.urbandictionary.com/sjw-23586.wav","http://wav.urbandictionary.com/sjw-34397.wav","http://wav.urbandictionary.com/sjw-39821.wa

They seemed to mishandle the callback and snip the output. Remove the callback parameter and it's fine. I've sent them the following message:

Hello! I'm a developer using your API in one of my client-side programs. First of all, thanks a bunch for it, it's been a great source of fun for me and my users.

Lately though the JSONP output appears to be snipped, for example: http://api.urbandictionary.com/v0/define?term=sjw&callback=foo

Currently ends with [...] "http://wav.urbandictionary.com/sjw-39821.wa

No string delimiter, no curly brace to match the outer object. That means the request fails and users don't see their amusing definitions, which might one day cause an uprise and they'll beat me to a pulp.

I don't want to be beaten to a pulp!

Thank you for your time.

Hopefully they'll answer and you won't kill me.

Zirak commented 8 years ago

So this seems to work now. Yay!