Created
June 3, 2015 10:54
-
-
Save rmnssnvsk/6a71de344455c4dc7055 to your computer and use it in GitHub Desktop.
Простая оповещалка о новых сообщениях в ВКонтакте
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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