Skip to content

Instantly share code, notes, and snippets.

@INZAME
Last active December 18, 2019 10:46
Show Gist options
  • Select an option

  • Save INZAME/b693a7e12042a22788cf76da3b114e75 to your computer and use it in GitHub Desktop.

Select an option

Save INZAME/b693a7e12042a22788cf76da3b114e75 to your computer and use it in GitHub Desktop.
import vk
from time import sleep as wait
from datetime import *
def auth(login='login_goes_here', password='password_goes_here'):
scope = 'friends, photos, audio, video, docs, notes, pages, status, wall, groups, notifications, offline'
session = vk.AuthSession(app_id=6964685, user_login=login, user_password=password, scope=scope)
api = vk.API(session, v='5.95', lang='ru')
return api
def main():
try:
api = auth()
except Exception:
pass
try:
get_name, get_lastname = api.account.getProfileInfo()['first_name'], api.account.getProfileInfo()['last_name']
except Exception:
pass
print('Logged in as: {} {}'.format(get_name, get_lastname))
while True:
today = date.today()
future = date(2020,7,2) # date goes here
until = (future - today).days
try:
api.status.set(text='Days until something: {}.'.format(until))
except Exception:
pass
wait(60)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment