CloudBotIRC / CloudBot

CloudBot - The simple, fast, expandable, open-source Python IRC Bot!
GNU General Public License v3.0
273 stars 250 forks source link

Weather Module Is Broken #200

Closed slamanna212 closed 8 years ago

slamanna212 commented 8 years ago

Server has all required dependencies and the weather module worked before but now when someone tries to use it, the sever spits this into the console:

Traceback (most recent call last): File "/home/TrollOP/CloudBot/cloudbot/plugin.py", line 376, in _execute_hook out = yield from self.bot.loop.run_in_executor(None, self._execute_hook_threaded, hook, event) File "/usr/lib/python3.4/asyncio/futures.py", line 386, in iter yield self # This tells Task to wait for completion. File "/usr/lib/python3.4/asyncio/tasks.py", line 287, in _wakeup value = future.result() File "/usr/lib/python3.4/asyncio/futures.py", line 275, in result raise self._exception File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run result = self.fn(_self.args, _self.kwargs) File "/home/TrollOP/CloudBot/cloudbot/plugin.py", line 340, in _execute_hook_threaded return hook.function(parameters) File "/home/TrollOP/CloudBot/plugins/weather.py", line 118, in weather weather_data['url'] = web.shorten(response["current_observation"]['ob_url']) File "/home/TrollOP/CloudBot/cloudbot/util/web.py", line 52, in shorten return impl.shorten(url, custom, key) File "/home/TrollOP/CloudBot/cloudbot/util/web.py", line 149, in shorten raise ServiceError(j['errormessage'], r) cloudbot.util.web.ServiceError: [HTTP 200] Rate limit exceeded - you must wait at least 1815 seconds before we'll service this request.

Red-M commented 8 years ago

I'm going to paste back some of your error to you.

cloudbot.util.web.ServiceError: [HTTP 200] Rate limit exceeded - you must wait at least 1815 seconds before we'll service this request.

slamanna212 commented 8 years ago

How do i fix that error?

Red-M commented 8 years ago

Please read.

cloudbot.util.web.ServiceError: [HTTP 200] Rate limit exceeded - you must wait at least 1815 seconds before we'll service this request.

slamanna212 commented 8 years ago

But i had just started the bot, and Weather underground lists 0 API hits today, so please read again, how do i fix this

slamanna212 commented 8 years ago

No matter when i do it, it comes up with that error

Red-M commented 8 years ago

File "/home/TrollOP/CloudBot/cloudbot/util/web.py", line 149, in shorten raise ServiceError(j['errormessage'], r) cloudbot.util.web.ServiceError: [HTTP 200] Rate limit exceeded - you must wait at least 1815 seconds before we'll service this request.

Red-M commented 8 years ago

You're using the shorten API too much.

slamanna212 commented 8 years ago

There have been 0 commands run from the bot, i have it in an empty IRC channel, no one is using it. Except when i test the weather command , which returns that result

Red-M commented 8 years ago

Except when i test the weather command , which returns that result

slamanna212 commented 8 years ago

Using the weather command once in a 10 minute period shouldnt trigger that result.If the bot cant handle a single command its completely useless. Unless you are going to be of actual help, plesae stop responding

Red-M commented 8 years ago

Please review the code that the shorten service uses then you may make remarks like that. You are making HTTP requests to an external service NOT provided by cloudbot or any of the contributors. That service may do anything that they like and as such has rate limited you, regardless of how many times you use ONE of the commands others however may be also using the URL shortening service.

There is nothing wrong with the bot itself, however we may need to look at other services to preform this action.

slamanna212 commented 8 years ago

Il just find help elsewhere since you seam to be too incompetent to assist further

edwardslabs commented 8 years ago

@slamanna212 @Red-M is correct. The error is caused by the web-shortener the bot is configured to use. The default is is.gd. If you are using is.gd for your default shortener you will need to see if they have ratelimited or otherwise blacklisted your IP or range of IPs.

edwardslabs commented 8 years ago

I helped @slamanna212 switch shorteners to goo.gl for weather.py since is.gd is blocking him.