Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import xchat
- import re
- import pynotify
- from subprocess import Popen
- n = pynotify.init("Xchat2 Ingress Notifications")
- __module_name__ = "Notify on Ingress Invite"
- __module_description__ = "Pops up a libnotify message when a message contianing something that looks like an Ingress invite is posted"
- __module_version__ = "0.1"
- def checkForIngress(word, word_eol, userdata):
- if word[2] == "#invites":
- msg = " ".join(word[3:])
- search = re.search("[0-9A-Z]{8}",msg)
- if search is not None:
- code = msg[search.start():search.end()]
- nick = word[0].split("!")[0].strip(":")
- n = pynotify.Notification(code,nick + " just posted it","ingress")
- n.show()
- Popen(["adb", "shell", "am", "start", "com.nianticproject.ingress/com.niantic.nemesis.NemesisActivity"])
- cb = Popen(["adb", "shell", "service", "call", "clipboard", "2", "i32", "1", "i32", "18", "s16", code])
- return xchat.EAT_NONE
- xchat.hook_server("PRIVMSG", checkForIngress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement