Skip to content

Instantly share code, notes, and snippets.

@rmnssnvsk
Created June 3, 2015 10:54
Show Gist options
  • Save rmnssnvsk/6a71de344455c4dc7055 to your computer and use it in GitHub Desktop.
Save rmnssnvsk/6a71de344455c4dc7055 to your computer and use it in GitHub Desktop.
Простая оповещалка о новых сообщениях в ВКонтакте
#!/bin/python3
import vk
import os
import time
def main():
print("Auth... ", end='')
vkapi = vk.API(user_login="<LOGIN>", user_password="<PASSWORD>", scope="friends,messages,offline", app_id="4814255")
print("OK")
while True:
print("Check for new messages... ", end='')
dialogs = vkapi.messages.getDialogs(unread=1)
print("OK")
if(dialogs["count"] != 0):
print("You have unread messages")
os.system('kdialog --msgbox "{0}" --title "VKMsgCatcher"'.format("You have unread messages!"))
print("Wating")
time.sleep(60)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment