From b0969874a3873462c77115f34f469e4daa4d0a08 Mon Sep 17 00:00:00 2001 From: spline Date: Fri, 7 Nov 2014 12:55:34 -0500 Subject: [PATCH] Quick fix to stop spammers. --- plugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin.py b/plugin.py index 06a93f4..f9bdd6d 100644 --- a/plugin.py +++ b/plugin.py @@ -383,6 +383,11 @@ class Weather(callbacks.Plugin): irc.reply("ERROR: Need a Wunderground API key. Set config plugins.Weather.apiKey and reload Weather.") return + # this is to stop spam. + if optinput and len(optinput) > 50: + irc.reply("ERROR: Locations should not be this long. Try again.") + return + # urlargs will be used to build the url to query the API. # besides lang, these are unmutable values that should not be changed. urlArgs = {'features':['conditions', 'forecast'],