Skip to content

Instantly share code, notes, and snippets.

@goxofy
Created April 13, 2024 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goxofy/805d1721a9fc9c69a10feec2fd63e521 to your computer and use it in GitHub Desktop.
Save goxofy/805d1721a9fc9c69a10feec2fd63e521 to your computer and use it in GitHub Desktop.
test
from pushover_open_client import Client, Message
class Pushover:
def __init__(self):
self.client = Client("creds.json")
def messageCallback(self, msgList):
if msgList:
for msg in msgList:
self.client.deleteMessages(msgList[-1].id)
return msg.message
def listenNewMsg(self):
msgList = self.client.getOutstandingMessages()
if msgList:
self.client.deleteMessages(msgList[-1].id)
return self.client.getWebSocketMessages(self.messageCallback)
pushover = Pushover()
while True:
code = pushover.listenNewMsg()
print(f"接收到验证码 {code}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment