Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
physical
Commits
67997353
Commit
67997353
authored
Apr 29, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
f90de1e8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
375 deletions
+0
-375
get_session.py
injection/data_sync/get_session.py
+0
-143
guanshui.txt
injection/data_sync/guanshui.txt
+0
-100
majia_email.txt
injection/data_sync/majia_email.txt
+0
-0
tasks.py
injection/data_sync/tasks.py
+0
-132
No files found.
injection/data_sync/get_session.py
deleted
100644 → 0
View file @
f90de1e8
import
requests
import
time
import
datetime
import
random
import
traceback
from
django.conf
import
settings
import
logging
DATABASES
=
settings
.
DATABASES
host
=
DATABASES
[
'default'
][
'HOST'
]
user
=
DATABASES
[
'default'
][
'USER'
]
port
=
DATABASES
[
'default'
][
'PORT'
]
db
=
DATABASES
[
'default'
][
'NAME'
]
passwd
=
DATABASES
[
'default'
][
'PASSWORD'
]
auto_click_url
=
"http://earth.igengmei.com/api/v1/like"
auto_reply_url
=
"http://earth.igengmei.com/api/v1/reply/create"
auto_follow_url
=
"http://earth.igengmei.com/api/v1/follow"
auto_urge_url
=
"http://earth.igengmei.com/api/v1/user/urge"
def
get_majia
():
try
:
data
=
open
(
"/srv/apps/physical/injection/data_sync/majia_email.txt"
)
list
=
[]
for
i
in
data
:
list
.
append
(
i
.
strip
(
'
\n
'
)
.
strip
(
','
))
maj
=
random
.
randint
(
1
,
len
(
list
))
user_id
=
list
[
maj
-
1
]
return
user_id
except
:
logging
.
error
(
"catch exception,get_majia:
%
s"
%
traceback
.
format_exc
())
return
None
def
get_cookies
(
user_id
):
try
:
with
open
(
"/srv/apps/cybertron/user_session.txt"
,
'r'
)
as
f
:
try
:
data
=
f
.
readlines
()
except
:
data
=
None
list
=
[]
for
i
in
data
:
list
.
append
(
i
.
strip
(
'
\n
'
)
.
split
(
","
))
for
i
in
list
:
if
user_id
==
i
[
0
]:
return
(
i
[
1
])
except
:
return
None
def
login
():
try
:
user_id
=
get_majia
()
cookies
=
get_cookies
(
user_id
)
if
cookies
is
not
None
:
return
{
'sessionid'
:
cookies
}
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
return
None
def
click
(
cookies_get
,
id
):
try
:
post_dict
=
{
'type'
:
0
,
'id'
:
id
}
response
=
requests
.
post
(
url
=
auto_click_url
,
cookies
=
cookies_get
,
data
=
post_dict
)
logging
.
info
(
"response.text:
%
s"
%
response
.
text
)
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
def
reply
(
cookies_get
,
id
,
content
):
try
:
post_dict
=
{
'topic_id'
:
id
,
'content'
:
content
}
response
=
requests
.
post
(
url
=
auto_reply_url
,
cookies
=
cookies_get
,
data
=
post_dict
)
logging
.
info
(
"response.text:
%
s"
%
response
.
text
)
except
:
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
def
time_conv
(
minutest
):
try
:
now
=
datetime
.
datetime
.
now
()
yes_time
=
now
-
datetime
.
timedelta
(
minutes
=
minutest
)
print
(
yes_time
)
return
yes_time
except
:
return
None
def
get_comments
():
try
:
data
=
open
(
"/srv/apps/physical/injection/data_sync/guanshui.txt"
,
"r"
)
list_guanshui
=
[]
for
i
in
data
:
list_guanshui
.
append
(
i
)
num1
=
random
.
randint
(
0
,
30
)
num2
=
random
.
randint
(
30
,
70
)
num3
=
random
.
randint
(
70
,
len
(
list_guanshui
))
comment1
=
list_guanshui
[
num1
-
1
]
comment2
=
list_guanshui
[
num2
-
1
]
comment3
=
list_guanshui
[
num3
-
1
]
comment_list
=
[
comment1
,
comment2
,
comment3
]
return
comment_list
except
:
return
None
injection/data_sync/guanshui.txt
deleted
100644 → 0
View file @
f90de1e8
照片色调很好看
用的什么调色工具呀
立马去get同款
我一个一看就会,动手就废的girl
为什么我拍不出来你的效果?
Po主用的什么拍照软件
这个好,学习了
真的是元气满满
很帅气!
这样好显气质!
好可爱啊,完全没有抵抗力了。
莫名好感中
满分颜值
超酷!
马住回看
请问发色是啥
请问是什么app拍的啊
滤镜要怎么选?
卖萌打滚求翻牌
有没有常用自拍姿势教程
拍照技术满分
日常夸奖博主
日常勾搭
背景是在哪里?
照片构图很好看
主要还是看颜值
你长得很像明星
支持一下
转需留存
拍照表情很自然
风格很好
这里是哪里呀?
种草了!
搭配小技巧get!
怎么都学不会的路过
太好了,新手学习了
一直支持,只求被翻牌!
好喜欢这种风格
好看,在哪儿买的
衣好有气质哦
这个我也会
拍照pose求出教程
小姐姐,作图app是啥
终于更新了
搭配的好好看
求同款
日常催更
get√
什么时候更新啊
果然只要瘦怎么都好看。
不错的哈哈
同款达不到楼主的效果
喜欢你的搭配
我拍出来为什么感觉比本人丑很多?
能多发点全身正面照吗?想看整体效果
这个真的很真实了
大圆脸合适吗?
成功引起了我的注意!
感觉很少女~
不错,继续加油
好看的人做什么都好看
都是人才!!!!
道理我都懂,就差一个脸!
不赞我良心都过意不去啊
爱你哟~
用手机可以拍出来吗?
使用相机拍的还是手机
我觉得很赞
颜色搭配很舒服
小姐姐有戴美瞳吗
看见这个帖心情变好了
不管怎么样先收藏了
更新更新更新
你和我朋友长得有点像
你的风格我都很喜欢
好看
我要有你这条件还需要啥拍照技术
太美了!
被圈粉了……
美而不作,我喜欢
楼主真的real真实了。
持续等更新
楼主加油,照片拍的不错,非常值得推荐。
大家花呗还了吗?
来啦来啦来啦来啦来啦
画面太治愈了
楼主辛苦啦
不错,跟着学习一下
心动,我要去试试
满满的干货,收藏好下次用
新技能get√
感觉不错mark一下
适合自己的才是最重要的
羡慕一下作者的颜
Omaga太好看了吧~
这张拍的不错
这个特效挺可爱的
翻我翻我~
这样很显脸小
关注啦
injection/data_sync/majia_email.txt
deleted
100644 → 0
View file @
f90de1e8
This diff is collapsed.
Click to expand it.
injection/data_sync/tasks.py
View file @
67997353
...
...
@@ -103,135 +103,3 @@ def sync_user_similar_score():
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
def
auto_click
(
pk_list
):
logging
.
info
(
"get--------auto_click--------------:
%
s"
%
pk_list
)
try
:
now
=
datetime
.
datetime
.
now
()
yes_time_str
=
now
.
strftime
(
'
%
Y-
%
m-
%
d'
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
topic_id_list
=
[]
if
len
(
pk_list
)
>
0
:
if
len
(
pk_list
)
==
1
:
cursor
.
execute
(
"SELECT id FROM topic WHERE id = "
+
str
(
pk_list
[
0
])
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and create_time LIKE '
%%%%%
s
%%%%
'"
%
yes_time_str
)
else
:
cursor
.
execute
(
"SELECT id FROM topic WHERE id in "
+
str
(
tuple
(
pk_list
))
+
" and user_id in (select user_id from user_extra where is_shadow = 0 ) and create_time LIKE '
%%%%%
s
%%%%
'"
%
yes_time_str
)
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
if
topic_id_list
:
try
:
def
fun_timer
():
cookies
=
login
()
if
cookies
:
logging
.
info
(
"get topic_id_list:
%
s"
%
topic_id_list
)
click
(
cookies
,
topic_id_list
[
0
][
0
])
global
timer
global
exec_count_click
exec_count_click
+=
1
if
exec_count_click
==
1
:
logging
.
info
(
"----------2-----------"
)
# sleep_time = random.randint(300, 540)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
if
exec_count_click
==
2
:
# sleep_time = random.randint(1000, 1900)
logging
.
info
(
"----------3-----------"
)
sleep_time
=
50
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
if
exec_count_click
>
2
:
pass
sleep_time
=
random
.
randint
(
300
,
540
)
logging
.
info
(
"----------1-----------"
)
timer
=
threading
.
Timer
(
10
,
fun_timer
)
# 首次启动
timer
.
start
()
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
else
:
pass
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
def
auto_reply
(
pk_list
):
logging
.
info
(
"get----------------------:
%
s"
%
pk_list
)
exec_count
=
0
try
:
now
=
datetime
.
datetime
.
now
()
yes_time_str
=
now
.
strftime
(
'
%
Y-
%
m-
%
d'
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
topic_id_list
=
[]
try
:
if
len
(
pk_list
)
>
0
:
if
len
(
pk_list
)
==
1
:
cursor
.
execute
(
"SELECT id FROM topic WHERE id = "
+
str
(
#
pk_list
[
0
])
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and create_time LIKE '
%%%%%
s
%%%%
' "
%
yes_time_str
)
else
:
cursor
.
execute
(
"SELECT id FROM topic WHERE id in "
+
str
(
tuple
(
# and create_time LIKE '%%%%%s%%%%'
pk_list
))
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and and create_time LIKE '
%%%%%
s
%%%%
'"
%
yes_time_str
)
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
except
:
pass
if
topic_id_list
:
try
:
def
fun_comment
():
cookies
=
login
()
if
cookies
:
comment_content
=
get_comments
()
comment
=
comment_content
[
0
]
reply
(
cookies
,
topic_id_list
[
0
][
0
],
comment
)
global
timer
global
exec_count
exec_count
+=
1
if
exec_count
==
1
:
sleep_time
=
random
.
randint
(
300
,
540
)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_comment
)
timer
.
start
()
if
exec_count
==
2
:
sleep_time
=
random
.
randint
(
1000
,
1900
)
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_comment
)
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
timer
=
threading
.
Timer
(
10
,
fun_comment
)
# 首次启动
timer
.
start
()
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
except
:
logging
.
error
(
"catch exception,main:
%
s"
%
traceback
.
format_exc
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment