Commit f4df8516 authored by 钟尚武's avatar 钟尚武

Merge branch 'wsy2' into 'master'

修改 自动关注脚本

See merge request !520
parents 76fc2c24 e85196ed
strategy part like es perform
容器运行命令
docker run -it -p 9999:9999 -d \
--volume=/etc/gm-config:/etc/gm-config \
--volume=/etc/resolv.conf:/etc/resolv.conf \
--volume=/srv/apps/physical/physical/settings_local.py:/srv/apps/physical/physical/settings_local.py \
--entrypoint="/bin/bash" physical-test:1.0 "-c" "source ~/.bashrc && celery -A physical worker -Q tapir-alpha --loglevel=DEBUG --maxtasksperchild 500 -c 62"
strategy part like es perform
容器运行命令
docker run -it -p 9999:9999 -d \
--volume=/etc/gm-config:/etc/gm-config \
--volume=/etc/resolv.conf:/etc/resolv.conf \
--volume=/srv/apps/physical/physical/settings_local.py:/srv/apps/physical/physical/settings_local.py \
--entrypoint="/bin/bash" physical-test:1.0 "-c" "source ~/.bashrc && celery -A physical worker -Q tapir-alpha --loglevel=DEBUG --maxtasksperchild 500 -c 62"
## 启动方式
### 方式1:[program:physical-linucb] 消费kafka数据
一个while True服务,去消费kafka数据,维护redis中device的tag_map
```python
source /srv/envs/physical/bin/activate && python manage.py trans2es_data2es_parallel -S linucb
```
### 方式2:[program:physical] rpc服务
启动rpc服务供后端调用, 接口都在search文件夹下的bind函数定义
```python
gunicorn gm_rpcd.wsgi:application --workers=1 --worker-class=gevent
--worker-connections=1024
--bind=0.0.0.0:9999
--user=gmuser
--chdir /srv/apps/physical/
--timeout 600
--log-level=debug
--error-logfile=/data/log/physical/app/gunicorn_error.log
--access-logfile=/data/log/physical/app/gunicorn_access.log
```
### 方式3 [program:physical-celery] celery 消息队列服务
mysql数据同步到es,入口文件:injection.data_sync.tasks.write_to_es
数据同步工作大部分在数据管道,只有小部分在这,暂时先不用管这个服务,需求用不到
```python
celery -A physical worker -Q tapir-alpha --loglevel=DEBUG --maxtasksperchild 500 -c 62
```
### 方式4 [program:physical-beat-celery] celery 消息队列定时(作用未知)
```python
celery -A physical beat
```
# 自动运行脚本
### venus服务端脚本
通过celery beat 运行
配置说明文件:venus/setting/base.py
具体脚本:venus/communityity/task/xxx.py
目前共5个脚本
1:每天保存用户扫脸图片:community.tasks.save_image_task.save_user_face_image
2:每天3点0分评论自动点赞:community.tasks.crontab_reply_vote_task.crontab_reply_vote
3:向用户推送兴趣标签:community.tasks.push_task.push_interest_tag_pictorial_to_user
4:向用户推送经验标签:community.tasks.push_task.push_topic_draft_task
5:推送主题草稿任务:community.tasks.push_task.push_topic_draft_task
### physical策略端脚本
在Alp-Test-Cos-test001服务器上,通过crontab -l查看
更新脚本
```bash
cp crontab.py /data/log/physical/app/crontab.py
python /data/log/physical/app/crontab.py
python /data/log/physical/app/crontabs.py
```
\ No newline at end of file
import random
ontime_list = [
"0 9 * * * source /srv/envs/physical/bin/activate && python /data/log/physical/app/crontab.py",
"10 9 * * * source /srv/envs/physical/bin/activate && python /data/log/physical/app/crontabs.py",
"0 9 * * * sh /data/log/cybertron/app/statistics_query.sh > /data/log/cybertron/app/statistics_query.log",
"*/5 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m true_click_one",
"02,12,22,32,42,52 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es-m true_click_two",
"00,10,20,30,40,50 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m true_click_three",
"02,12,22,32,42,52 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es-m true_click_four",
"06,16,26,36,46,56 * * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m true_click_five",
"0 14 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_star_urge",
"0 10 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_urge1",
"30 10 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_urge2",
"0 10 * * 3 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_lunch_app",
"30 10 * * 3 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_lunch_app2",
"*/5 * * * 1 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_5m_by_followed",
"1 */2 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_2h_by_post_and_regist",
"0 9 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m get_login_session",
"0 0 * * 3 source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m get_user_id",
"0 14,18,22 * * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m principal_online_comment1"
]
random_time_list = [
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_1d_by_regist",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m auto_follow_per_1d_by_post",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m answer_reply1",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m answer_reply2",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m answer_reply3",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m answer_reply5",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m answer_reply7",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m yesterday_topic_reply",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m before_yesterday_topic_reply",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m three_days_ago_topic_reply",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m five_days_ago_topic_reply",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m seven_days_ago_reply",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m reply_comment1",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m reply_comment3",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m reply_comment2",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m reply_comment5",
"* * * source /srv/envs/physical/bin/activate && cd /srv/apps/physical && python manage.py trans2es_mapping2es -m reply_comment7"]
###随机生成10-23的一个数字 代表小时
ss1 = random.choices(range(10, 23), k=100)
###随机生成1-60的一个数字 表示分钟
ss2 = random.choices(range(1, 50), k=100)
for i in range(len(random_time_list)):
ontime_list.append(str(ss2[i]) + " " + str(ss1[i]) + " " + str(random_time_list[i]))
data = open("/data/log/physical/app/conf.txt", "w")
for var in ontime_list:
data.write(var)
data.write("\n")
......@@ -10,7 +10,8 @@ from trans2es.type_info import get_type_info_map, TypeInfo
from vest.reply import true_comment_one, true_comment_two, true_comment_three, one_seven_topic_comment
from vest.click import true_click_five, true_click_two, true_click_four, true_click_one, true_click_three, \
one_seven_star_topic
from vest.follow import auto_follow, auto_follow_new
from vest.follow import auto_follow, auto_follow_new, auto_follow_per_5m_by_followed, \
auto_follow_per_1d_by_regist, auto_follow_per_1d_by_post, auto_follow_per_2h_by_post_and_regist
from vest.urge import auto_star_urge, auto_lunch_app, auto_lunch_app2, auto_urge1, auto_urge2
from vest.fix import fix_no_comment_click
from vest.reply_answer import reply_comment2, reply_comment3, answer_reply2, answer_reply3, answer_reply1, \
......@@ -114,6 +115,14 @@ class Command(BaseCommand):
auto_follow.auto_follow()
if options["mvest"] == "auto_follow_new":
auto_follow_new.auto_follow_new()
if options['mvest'] == "auto_follow_per_5m_by_followed":
auto_follow_per_5m_by_followed.auto_follow_per_5m_by_followed()
if options['mvest'] == "auto_follow_per_1d_by_regist":
auto_follow_per_1d_by_regist.auto_follow_per_1d_by_regist()
if options['mvest'] == "auto_follow_per_1d_by_post":
auto_follow_per_1d_by_post.auto_follow_per_1d_by_post()
if options['mvest'] == "auto_follow_per_2h_by_post_and_regist":
auto_follow_per_2h_by_post_and_regist.auto_follow_per_2h_by_post_and_regist()
# 补足
if options["mvest"] == "fix_no_comment_click":
......
This diff is collapsed.
import pymysql
import random
import traceback
import logging
from threading import Thread
from vest.request.auto_request import login, time_convs, follow
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=3):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
# 发贴后
cursor.execute(
"select t.user_id from topic t left join user_extra u on t.user_id = u.user_id "
"where u.is_shadow=0 and t.create_time > '%s' and t.create_time < '%s' "
"and t.content_level >= %s and t.content_level <= %s " % (numtime, numtime2, str(content_level_low), str(content_level_top)))
res = cursor.fetchall()
return res and [i for i, in res] or []
def batch_handle(auto_follow_list):
for user_id in auto_follow_list:
try:
cookies = login()
if cookies is not None:
follow(cookies, user_id)
except:
pass
def auto_follow_per_1d_by_post():
# 发帖触发自动加粉丝
auto_follow_list = []
try:
# 0-3星
# 1天前发的帖子:[2-6]个粉丝
numtime1, numtime2 = time_convs(1, 1)
user_ids = get_commnet_id(numtime2, numtime1, content_level_low=0, content_level_top=3)
for user_id in user_ids:
follow_num = random.randint(2, 6)
for i in range(follow_num):
auto_follow_list.append(user_id)
# 2-15天前发的帖子:[0-1]个粉丝
numtime1, numtime2 = time_convs(2, 15)
user_ids = get_commnet_id(numtime2, numtime1, content_level_low=0, content_level_top=3)
for user_id in user_ids:
follow_num = random.randint(0, 1)
for i in range(follow_num):
auto_follow_list.append(user_id)
# 15天前或更早发的帖子:每隔11天[0-2]个粉丝
numtime1, numtime2 = time_convs(2, 15)
user_ids = get_commnet_id('0', numtime2, content_level_low=0, content_level_top=3)
for user_id in user_ids:
follow_num = random.randint(1, 6)
if follow_num == 6:
auto_follow_list.append(user_id)
# 4-6星
# 1天前发的帖子:[5-10]个粉丝
numtime1, numtime2 = time_convs(1, 1)
user_ids = get_commnet_id(numtime2, numtime1, content_level_low=4, content_level_top=6)
for user_id in user_ids:
follow_num = random.randint(5, 10)
for i in range(follow_num):
auto_follow_list.append(user_id)
# 2-15天前发的帖子:[0-5]个粉丝
numtime1, numtime2 = time_convs(2, 15)
user_ids = get_commnet_id(numtime2, numtime1, content_level_low=4, content_level_top=6)
for user_id in user_ids:
follow_num = random.randint(0, 5)
for i in range(follow_num):
auto_follow_list.append(user_id)
# 15天前或更早发的帖子:每隔11天[0-2]个粉丝
numtime1, numtime2 = time_convs(2, 15)
user_ids = get_commnet_id('0', numtime2, content_level_low=4, content_level_top=6)
for user_id in user_ids:
follow_num = random.randint(1, 6)
if follow_num == 6:
auto_follow_list.append(user_id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_follow_per_1d_by_post: len %s' % len(auto_follow_list))
print('auto_follow_per_1d_by_post: len %s' % len(auto_follow_list))
total = len(auto_follow_list)
limit = (total + 10) // 10
for start in range(0, total, limit):
batch = auto_follow_list[start:start + limit]
t = Thread(target=batch_handle, args=[batch])
t.start()
import pymysql
import random
import traceback
import logging
from threading import Thread
from vest.request.auto_request import login, time_convs, follow
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_commnet_id(numtime, numtime2):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
# 注册后
cursor.execute(
"select a.user_id from account_user a left join user_extra u on a.user_id = u.user_id "
"WHERE a.create_time > '%s' and a.create_time < '%s' and u.is_shadow = 0 " % (numtime, numtime2))
res = cursor.fetchall()
return res and [i for i, in res] or []
def batch_handle(auto_follow_list):
for user_id in auto_follow_list:
try:
cookies = login()
if cookies is not None:
follow(cookies, user_id)
except:
pass
def auto_follow_per_1d_by_regist():
# 注册事件触发自动加粉丝
auto_follow_list = []
try:
# 1天前注册:[1-3]个粉丝
numtime1, numtime2 = time_convs(1, 1)
user_ids= get_commnet_id(numtime2, numtime1)
for user_id in user_ids:
follow_num = random.randint(1, 3)
for i in range(follow_num):
auto_follow_list.append(user_id)
# 2-10天前注册:[0-1]个粉丝
numtime1, numtime2 = time_convs(2, 12)
user_ids = get_commnet_id(numtime2, numtime1)
for user_id in user_ids:
follow_num = random.randint(0, 1)
for i in range(follow_num):
auto_follow_list.append(user_id)
# 10天前注册:每隔12天[0-1]个赞
numtime1, numtime2 = time_convs(1, 12)
user_ids = get_commnet_id('0', numtime2)
for user_id in user_ids:
follow_num = random.randint(1, 24)
if follow_num == 12:
auto_follow_list.append(user_id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_follow_per_1d_by_regist: len %s' % len(auto_follow_list))
print('auto_follow_per_1d_by_regist: len %s' % len(auto_follow_list))
total = len(auto_follow_list)
limit = (total + 10) // 10
for start in range(0, total, limit):
batch = auto_follow_list[start:start + limit]
t = Thread(target=batch_handle, args=[batch])
t.start()
import pymysql
import random
import traceback
import logging
from threading import Thread
from vest.request.auto_request import login, time_conv_hour, follow
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_commnet_id(numtime, numtime2, content_level_low=0, content_level_top=6):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
# 发贴后
cursor.execute(
"select t.user_id from topic t left join user_extra u on t.user_id = u.user_id "
"where u.is_shadow=0 and t.create_time > '%s' and t.create_time < '%s' "
"and t.content_level >= %s and t.content_level <= %s " % (numtime, numtime2, str(content_level_low), str(content_level_top)))
res_post = cursor.fetchall()
# 注册后
cursor.execute(
"select a.user_id from account_user a left join user_extra u on a.user_id = u.user_id "
"WHERE a.create_time > '%s' and a.create_time < '%s' and u.is_shadow = 0 " % (numtime, numtime2))
res_regist = cursor.fetchall()
res = []
res.extend(res_regist)
res.extend(res_post)
return res and [i for i, in res] or []
def batch_handle(auto_follow_list):
for user_id in auto_follow_list:
try:
cookies = login()
if cookies is not None:
follow(cookies, user_id)
except:
pass
def auto_follow_per_2h_by_post_and_regist():
# 发帖,注册触发自动加粉丝
auto_follow_list = []
try:
# 发帖,注册后2小时内:[1-3]个粉丝
numtime1, numtime2 = time_conv_hour(0, 2)
user_ids = get_commnet_id(numtime2, numtime1, content_level_low=0, content_level_top=6)
for user_id in user_ids:
follow_num = random.randint(1, 3)
for i in range(follow_num):
auto_follow_list.append(user_id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
logging.info('auto_follow_per_2h_by_post_and_regist: len %s' % len(auto_follow_list))
print('auto_follow_per_2h_by_post_and_regist: len %s' % len(auto_follow_list))
total = len(auto_follow_list)
limit = (total + 10) // 10
for start in range(0, total, limit):
batch = auto_follow_list[start:start + limit]
t = Thread(target=batch_handle, args=[batch])
t.start()
import pymysql
import traceback
import logging
from vest.request.auto_request import login, follow, time_conv_minute
from vest.request.auto_request import host, user, db, passwd
from vest.data.majia_user_ids import majia_user_ids_dict
from libs.error import logging_exception
def get_user_id(numtime):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT f.user_id, f.follow_id FROM user_follow f left join user_extra e on f.follow_id = e.user_id "
"WHERE f.create_time >= '%s' and e.is_shadow = 1 " % numtime
)
data_comment = cursor.fetchall()
return data_comment and [i for i in data_comment] or []
def auto_follow_per_5m_by_followed():
# 如果马甲被用户关注,马甲即反向关注用户, 被关注5分钟后
try:
numtime1, numtime2, c = time_conv_minute(1, 5)
users = get_user_id(numtime2)
try:
for user in users and users:
user_id = user[0]
cookies = login(str(majia_user_ids_dict.get(str(user[1]))))
if cookies is not None:
follow(cookies, user_id)
except:
pass
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -82,9 +82,10 @@ def get_cookies(user_id):
return None
def login():
def login(user_id=None):
try:
user_id = get_majia()
if not user_id:
user_id = get_majia()
logging.info("get user_id:%s" % user_id)
cookies = get_cookies(user_id)
......@@ -112,6 +113,7 @@ def logins(user_id):
def click(cookies_get, id):
# 点赞
try:
post_dict = {
'type': 0,
......@@ -168,6 +170,16 @@ def time_conv_minute(minutest, minutest2):
return None
def time_conv_hour(minutest, minutest2):
try:
now = datetime.datetime.now()
yes_time = now - datetime.timedelta(hours=minutest)
yes_time2 = now - datetime.timedelta(hours=minutest2)
return yes_time, yes_time2
except:
return None
def time_now(minutest):
try:
now = datetime.datetime.now()
......@@ -178,6 +190,11 @@ def time_now(minutest):
def time_convs(numtime, numtime2):
'''
params: 1, 2
datetime.now(): 2019-10-09 10:35:50.231463
return: 2019-10-08 23:59:59.000000 2019-10-07 00:00:00.000000
'''
try:
now = datetime.datetime.now()
yes_time = now - datetime.timedelta(days=numtime)
......@@ -190,7 +207,6 @@ def time_convs(numtime, numtime2):
logging.info("get yes_time_str:%s" % yes_time_str)
logging.info("get yes_time_str2:%s" % yes_time_str2)
return yes_time_str, yes_time_str2
except:
return None
......
import pymysql
import datetime
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'alpha',
'USER': 'work',
'PASSWORD': 'Gengmei123!',
'HOST': '172.21.36.16',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'master': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'alpha',
'USER': 'work',
'PASSWORD': 'Gengmei123!',
'HOST': '172.21.36.6',
'PORT': '3306',
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'face': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'face',
'USER': 'work',
'PASSWORD': 'Gengmei123!',
'HOST': '172.21.36.16',
'PORT': '3306',
# 'CONN_MAX_AGE': None,
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
},
'commodity': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'commodity',
'USER': 'work',
'PASSWORD': 'Gengmei123!',
'HOST': '172.21.36.16',
'PORT': '3306',
# 'CONN_MAX_AGE': None,
'OPTIONS': {
"init_command": "SET foreign_key_checks = 0;",
"charset": "utf8mb4",
},
}
}
host = DATABASES['default']['HOST']
user = DATABASES['default']['USER']
port = DATABASES['default']['PORT']
db = DATABASES['default']['NAME']
passwd = DATABASES['default']['PASSWORD']
def time_convs(numtime, numtime2):
'''
params: 1, 2
datetime.now(): 2019-10-09 10:35:50.231463
return: 2019-10-08 23:59:59.000000 2019-10-07 00:00:00.000000
'''
try:
now = datetime.datetime.now()
yes_time = now - datetime.timedelta(days=numtime)
yes_time_str = yes_time.strftime('%Y-%m-%d')
yes_time_str = yes_time_str + ' 23:59:59.000000'
yes_time2 = now - datetime.timedelta(days=numtime2)
yes_time_str2 = yes_time2.strftime('%Y-%m-%d')
yes_time_str2 = yes_time_str2 + ' 00:00:00.000000'
return yes_time_str, yes_time_str2
except:
return None
def get_commnet_id(numtime, numtime2):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
# 发贴后
cursor.execute(
"select user_id from topic WHERE create_time > '%s' and create_time < '%s' " % (numtime, numtime2))
data_new_user = cursor.fetchall()
all_data = list(data_new_user)
user_id_list = []
for i in all_data and all_data:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
user_id_list.append(i)
pc.close()
return user_id_list
# numtime1, numtime2 = time_convs(1, 1)
# user_id = get_commnet_id(numtime2, numtime1)
# def time_conv_minute(minutest, minutest2):
# try:
# now = datetime.datetime.now()
# minute = datetime.datetime.now().minute
# yes_time = now - datetime.timedelta(minutes=minutest)
# yes_time2 = now - datetime.timedelta(minutes=minutest2)
# return yes_time, yes_time2, minute
# except:
# return None
#
# a, b, c = time_conv_minute(0, 5)
#
# print(a, b)
import requests
auto_follow_url = 'http://earth.gmapp.env/api/v1/follow'
def follow(cookies_get, id):
post_dict = {
'type': 1,
'id': id
}
response = requests.post(url=auto_follow_url,
cookies=cookies_get,
data=post_dict)
print(response.text)
follow({'sessionid': 'qsukyafj7ub2f43f33g2jm0kkvqf0sa7'}, 241765445)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment