diff options
Diffstat (limited to 'module/plugins/hooks/AndroidPhoneNotify.py')
-rw-r--r-- | module/plugins/hooks/AndroidPhoneNotify.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py new file mode 100644 index 000000000..d6bf64db4 --- /dev/null +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- + + +from module.plugins.Hook import Hook +from module.network.RequestFactory import getURL + +class AndroidPhoneNotify(Hook): + __name__ = "AndroidPhoneNotify" + __type__ = "hook" + __version__ = "0.01" + + __config__ = [("apikey", "str", "apikey", ""), + ("appname", "str", "ApplicationName", "pyLoad"), + ("notifycaptcha", "bool", "Send captcha notifications (maybe usefull if premium fails)", False)] + + __description__ = """Send push notifications to your Android Phone using notifymyandroid.com""" + __license__ = "GPLv3" + __authors__ = [("Steven Kosyra", "steven.kosyra@gmail.com")] + + + def packageFinished(self, pypack): + self.genUrl("Package finished:",pypack.name) + + + def newCaptchaTask(self, task): + if self.getConfig("notifycaptcha"): + self.genUrl("Captcha","new Captcha request") + + + + def genUrl(self,event, msg): + self.response(event, msg) + + + + def response(self, event, msg): + html = getURL("http://www.notifymyandroid.com/publicapi/notify?apikey=" + self.getConfig("apikey") + "&application=" + self.getConfig("appname") + "&event=" + str(event) + "&description= " + str(msg) + "") |