Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
戒酒的李白
2024-07-04 11:21:27 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
ab7f4be86e7d976597afb1f4360c03d2b60fb69e
ab7f4be8
2 parents
00d38ca6
c7533a4a
Merge branch 'main' of
https://github.com/666ghj/Weibo_PublicOpinion_AnalysisSystem
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
spider/saveData.py
utils/query.py
wordCloudPicture.py
spider/saveData.py
View file @
ab7f4be
...
...
@@ -2,7 +2,7 @@ import os
from
sqlalchemy
import
create_engine
import
pandas
as
pd
engine
=
create_engine
(
'mysql+pymysql://XiaoXueQi:XiaoXueQi@
10.92.35.13
/Weibo_PublicOpinion_AnalysisSystem?charset=utf8mb4'
)
engine
=
create_engine
(
'mysql+pymysql://XiaoXueQi:XiaoXueQi@
47.92.235.6
/Weibo_PublicOpinion_AnalysisSystem?charset=utf8mb4'
)
def
save_to_sql
():
try
:
...
...
utils/query.py
View file @
ab7f4be
from
pymysql
import
*
conn
=
connect
(
host
=
'
10.92.35.13
'
,
port
=
3306
,
user
=
'XiaoXueQi'
,
password
=
'XiaoXueQi'
,
database
=
'Weibo_PublicOpinion_AnalysisSystem'
)
conn
=
connect
(
host
=
'
47.92.235.6
'
,
port
=
3306
,
user
=
'XiaoXueQi'
,
password
=
'XiaoXueQi'
,
database
=
'Weibo_PublicOpinion_AnalysisSystem'
)
cursor
=
conn
.
cursor
()
def
query
(
sql
,
params
,
type
=
"no_select"
):
params
=
tuple
(
params
)
...
...
wordCloudPicture.py
View file @
ab7f4be
...
...
@@ -9,7 +9,7 @@ def stopWordList():
return
[
line
.
strip
()
for
line
in
open
(
'./model/stopWords.txt'
,
encoding
=
'utf8'
)
.
readlines
()]
def
get_img
(
field
,
tableName
,
targetImgSrc
,
resImgSrc
):
con
=
connect
(
host
=
'
localhost'
,
user
=
'root'
,
password
=
'root'
,
database
=
'weiboarticles
'
,
port
=
3306
,
charset
=
'utf8mb4'
)
con
=
connect
(
host
=
'
47.92.235.6'
,
user
=
'XiaoXueQi'
,
password
=
'XiaoXueQi'
,
database
=
'Weibo_PublicOpinion_AnalysisSystem
'
,
port
=
3306
,
charset
=
'utf8mb4'
)
cuser
=
con
.
cursor
()
sql
=
f
'select {field} from {tableName}'
cuser
.
execute
(
sql
)
...
...
Please
register
or
login
to post a comment