Набросал 2 скрипта для вк. Вечный онлайн и АвтоСтатус, вроде работают Вечный онлайн import vk import time token = "Токен" #Сюда вводим свой токен. session = vk.Session(access_token = token) api = vk.API(session, v = "5.95") while True: exit = api.account.setOnline(voip = 0) time.sleep(180) Code import vk import time token = "Токен" #Сюда вводим свой токен. session = vk.Session(access_token = token) api = vk.API(session, v = "5.95") while True: exit = api.account.setOnline(voip = 0) time.sleep(180) АвтоСтатус(С модулем вк) from urllib import request import requests import datetime import urllib import json import time import vk token = "Токен" #Сюда вводим свой токен. timeKD = 60 #Сюда вводим время обновления статуса.(Время в секундах) session = vk.Session(access_token = token) api = vk.API(session, v = "5.95") def startStatus(): getCountry = api.account.getProfileInfo() city = getCountry.get("city").get("title") url = "http://api.openweathermap.org/data/2.5/weather" parameters = { 'q': city, 'appid': "778d98cf94b6609bec655b872f24b907", 'units':'metric', 'lang' : 'ru'} res = requests.get(url, params = parameters) data = res.json() getLikes = api.photos.get(album_id = "profile", rev = "1", extended = "1", count = "1") getLikes = getLikes.get("items") getLikes = getLikes[0] getLikes = getLikes["likes"] getLikes = getLikes["count"] getValuts = requests.get("https://currate.ru/api/?get=rates&pairs=USDRUB,EURRUB&key=094e4174c4f7140bb3d16d13d8d9ab00") getValuts = getValuts.json() getValuts = getValuts.get("data") getDollar = getValuts.get("USDRUB") getEuro = getValuts.get("EURRUB") getDollar = getDollar[:getDollar.find('.')] getEuro = getEuro[:getEuro.find('.')] today = datetime.datetime.today() nowTime = today.strftime("%H:%M") nowDate = today.strftime("%d.%m.%Y") statusOut = api.status.set(text = "⌛Время: {0} | Дата: {1} | ⛅Погода в '{2}': {3}℃ | ❤Лайков на аве: {4} | Доллар: {5}р | Евро: {6}р".format(nowTime, nowDate, data["name"], str(data["main"]["temp"]), getLikes, getDollar, getEuro)) print("Если вывело цифру '1', значит статус был успешно установлен: ", statusOut) while True: startStatus() time.sleep(timeKD) Code from urllib import request import requests import datetime import urllib import json import time import vk token = "Токен" #Сюда вводим свой токен. timeKD = 60 #Сюда вводим время обновления статуса.(Время в секундах) session = vk.Session(access_token = token) api = vk.API(session, v = "5.95") def startStatus(): getCountry = api.account.getProfileInfo() city = getCountry.get("city").get("title") url = "http://api.openweathermap.org/data/2.5/weather" parameters = { 'q': city, 'appid': "778d98cf94b6609bec655b872f24b907", 'units':'metric', 'lang' : 'ru'} res = requests.get(url, params = parameters) data = res.json() getLikes = api.photos.get(album_id = "profile", rev = "1", extended = "1", count = "1") getLikes = getLikes.get("items") getLikes = getLikes[0] getLikes = getLikes["likes"] getLikes = getLikes["count"] getValuts = requests.get("https://currate.ru/api/?get=rates&pairs=USDRUB,EURRUB&key=094e4174c4f7140bb3d16d13d8d9ab00") getValuts = getValuts.json() getValuts = getValuts.get("data") getDollar = getValuts.get("USDRUB") getEuro = getValuts.get("EURRUB") getDollar = getDollar[:getDollar.find('.')] getEuro = getEuro[:getEuro.find('.')] today = datetime.datetime.today() nowTime = today.strftime("%H:%M") nowDate = today.strftime("%d.%m.%Y") statusOut = api.status.set(text = "⌛Время: {0} | Дата: {1} | ⛅Погода в '{2}': {3}℃ | ❤Лайков на аве: {4} | Доллар: {5}р | Евро: {6}р".format(nowTime, nowDate, data["name"], str(data["main"]["temp"]), getLikes, getDollar, getEuro)) print("Если вывело цифру '1', значит статус был успешно установлен: ", statusOut) while True: startStatus() time.sleep(timeKD) АвтоСтатус(Только запросами) from urllib import request import requests import datetime import urllib import json import time token = "Токен" #Сюда вводим свой токен. timeKD = 60 #Сюда вводим время обновления статуса.(Время в секундах) def startStatus(): getCountry = requests.get("https://api.vk.com/method/account.getProfileInfo?v=5.95&access_token={0}".format(token)) getCountry = getCountry.json() getCountry = getCountry["response"] getCountry = getCountry["city"] city = getCountry["title"] url = "http://api.openweathermap.org/data/2.5/weather" parameters = { 'q': city, 'appid': "778d98cf94b6609bec655b872f24b907", 'units':'metric', 'lang' : 'ru'} res = requests.get(url, params = parameters) data = res.json() getLikes = requests.get("https://api.vk.com/method/photos.get?album_id=profile&rev=1&extended=1&count=1&v=5.95&access_token={0}".format(token)) getLikes = getLikes.json() getLikes = getLikes["response"] getLikes = getLikes["items"] getLikes = getLikes[0] getLikes = getLikes["likes"] getLikes = getLikes["count"] getValuts = requests.get("https://currate.ru/api/?get=rates&pairs=USDRUB,EURRUB&key=094e4174c4f7140bb3d16d13d8d9ab00") getValuts = getValuts.json() getValuts = getValuts.get("data") getDollar = getValuts.get("USDRUB") getEuro = getValuts.get("EURRUB") getDollar = getDollar[:getDollar.find('.')] getEuro = getEuro[:getEuro.find('.')] today = datetime.datetime.today() nowTime = today.strftime("%H:%M") nowDate = today.strftime("%d.%m.%Y") statusSave = ("⌛Время: {0} | Дата: {1} | ⛅Погода в '{2}': {3}℃ | ❤Лайков на аве: {4} | Доллар: {5}р | Евро: {6}р".format(nowTime, nowDate, data["name"], str(data["main"]["temp"]), getLikes, getDollar, getEuro)) statusOut = "https://api.vk.com/method/status.set?text=" + statusSave + "&v=5.95&access_token={0}".format(token) print("Статус был обновлён") while True: startStatus() time.sleep(timeKD) Code from urllib import request import requests import datetime import urllib import json import time token = "Токен" #Сюда вводим свой токен. timeKD = 60 #Сюда вводим время обновления статуса.(Время в секундах) def startStatus(): getCountry = requests.get("https://api.vk.com/method/account.getProfileInfo?v=5.95&access_token={0}".format(token)) getCountry = getCountry.json() getCountry = getCountry["response"] getCountry = getCountry["city"] city = getCountry["title"] url = "http://api.openweathermap.org/data/2.5/weather" parameters = { 'q': city, 'appid': "778d98cf94b6609bec655b872f24b907", 'units':'metric', 'lang' : 'ru'} res = requests.get(url, params = parameters) data = res.json() getLikes = requests.get("https://api.vk.com/method/photos.get?album_id=profile&rev=1&extended=1&count=1&v=5.95&access_token={0}".format(token)) getLikes = getLikes.json() getLikes = getLikes["response"] getLikes = getLikes["items"] getLikes = getLikes[0] getLikes = getLikes["likes"] getLikes = getLikes["count"] getValuts = requests.get("https://currate.ru/api/?get=rates&pairs=USDRUB,EURRUB&key=094e4174c4f7140bb3d16d13d8d9ab00") getValuts = getValuts.json() getValuts = getValuts.get("data") getDollar = getValuts.get("USDRUB") getEuro = getValuts.get("EURRUB") getDollar = getDollar[:getDollar.find('.')] getEuro = getEuro[:getEuro.find('.')] today = datetime.datetime.today() nowTime = today.strftime("%H:%M") nowDate = today.strftime("%d.%m.%Y") statusSave = ("⌛Время: {0} | Дата: {1} | ⛅Погода в '{2}': {3}℃ | ❤Лайков на аве: {4} | Доллар: {5}р | Евро: {6}р".format(nowTime, nowDate, data["name"], str(data["main"]["temp"]), getLikes, getDollar, getEuro)) statusOut = "https://api.vk.com/method/status.set?text=" + statusSave + "&v=5.95&access_token={0}".format(token) print("Статус был обновлён") while True: startStatus() time.sleep(timeKD) Tags Автостатус Вечный онлайн Бесконечный онлайн Питон Python Пайтон Вк скрипты Автоматическая смена статуса
Сделал обработчик ошибок, и немного красивее код from urllib import request import requests import datetime import urllib import json import time token = "" #Сюда вводим свой токен. timeKD = 60 #Сюда вводим время обновления статуса.(Время в секундах) def startStatus(): getCountry = requests.get(f"https://api.vk.com/method/account.getProfileInfo?v=5.95&access_token={token}").json() try: city = getCountry["response"]["city"]["title"] except KeyError: print("У профиля не указан город, по умолчанию была выбрана Москва.") city = "Москва" data = requests.get("http://api.openweathermap.org/data/2.5/weather", params = {"q": city, "appid": "778d98cf94b6609bec655b872f24b907", "units": "metric", "lang": "ru"}).json() try: getLikes = requests.get(f"https://api.vk.com/method/photos.get?album_id=profile&rev=1&extended=1&count=1&v=5.95&access_token={token}").json() getLikes = getLikes["response"]["items"][0]["likes"]["count"] except IndexError: print("У профиля отсутсвует аватар или лайки.") getLikes = 0 getValuts = requests.get("https://currate.ru/api/?get=rates&pairs=USDRUB,EURRUB&key=6780a6de85b0690a6e0f02e6fc5bfd4f").json().get("data") Dollar = getValuts.get("USDRUB") Euro = getValuts.get("EURRUB") Dollar = Dollar[:Dollar.find('.')] Euro = Euro[:Euro.find('.')] today = datetime.datetime.today() nowTime = today.strftime("%H:%M") nowDate = today.strftime("%d.%m.%Y") statusSave = ("Время: {0} | Дата: {1} | Погода в '{2}': {3}℃ | Лайков на аве: {4} | Доллар: {5}р | Евро: {6}р".format(nowTime, nowDate, data["name"], str(data["main"]["temp"]), getLikes, Dollar, Euro)) statusOut = requests.get(f"https://api.vk.com/method/status.set?text={statusSave}&v=5.95&access_token={token}").json() if statusOut.get("error", None): print(f"Не удалось обновить статус сервер вернул неверный код ответа: {statusOut}") else: print(f"Статус был обновлен") while True: startStatus() time.sleep(timeKD) Code from urllib import request import requests import datetime import urllib import json import time token = "" #Сюда вводим свой токен. timeKD = 60 #Сюда вводим время обновления статуса.(Время в секундах) def startStatus(): getCountry = requests.get(f"https://api.vk.com/method/account.getProfileInfo?v=5.95&access_token={token}").json() try: city = getCountry["response"]["city"]["title"] except KeyError: print("У профиля не указан город, по умолчанию была выбрана Москва.") city = "Москва" data = requests.get("http://api.openweathermap.org/data/2.5/weather", params = {"q": city, "appid": "778d98cf94b6609bec655b872f24b907", "units": "metric", "lang": "ru"}).json() try: getLikes = requests.get(f"https://api.vk.com/method/photos.get?album_id=profile&rev=1&extended=1&count=1&v=5.95&access_token={token}").json() getLikes = getLikes["response"]["items"][0]["likes"]["count"] except IndexError: print("У профиля отсутсвует аватар или лайки.") getLikes = 0 getValuts = requests.get("https://currate.ru/api/?get=rates&pairs=USDRUB,EURRUB&key=6780a6de85b0690a6e0f02e6fc5bfd4f").json().get("data") Dollar = getValuts.get("USDRUB") Euro = getValuts.get("EURRUB") Dollar = Dollar[:Dollar.find('.')] Euro = Euro[:Euro.find('.')] today = datetime.datetime.today() nowTime = today.strftime("%H:%M") nowDate = today.strftime("%d.%m.%Y") statusSave = ("Время: {0} | Дата: {1} | Погода в '{2}': {3}℃ | Лайков на аве: {4} | Доллар: {5}р | Евро: {6}р".format(nowTime, nowDate, data["name"], str(data["main"]["temp"]), getLikes, Dollar, Euro)) statusOut = requests.get(f"https://api.vk.com/method/status.set?text={statusSave}&v=5.95&access_token={token}").json() if statusOut.get("error", None): print(f"Не удалось обновить статус сервер вернул неверный код ответа: {statusOut}") else: print(f"Статус был обновлен") while True: startStatus() time.sleep(timeKD)
Нахуя изобретать 2007 год с этими скриптами? Их в сети хуева туча разных версий для сервера/хостинга. Уже и приложения и сайты со статусами/онлайнами были и есть по сей день, но актуальности этого говна нет