Last active
May 15, 2017 09:52
-
-
Save skar404/807e5fee2a01c37740a99c2b5492a18d 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
# -*- coding: utf-8 -*- | |
import vk_api | |
def main(): | |
login, password = 'user@user.ru', '12345678' | |
vk_session = vk_api.VkApi(login, password) | |
try: | |
vk_session.authorization() | |
except vk_api.AuthorizationError as error_msg: | |
print(error_msg) | |
return | |
vk = vk_session.get_api() | |
response = vk.friends.get(fields='sex') | |
if response['items']: | |
for i in response['items']: | |
if i['sex'] == 1: | |
vk.messages.send(user_id=i['id'], message='С 23 февраля, это Дэн') | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment