Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
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
backend
crawler
Commits
57d194d2
Commit
57d194d2
authored
Jul 22, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
31d9dfc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
test_read_config.py
test/test_read_config.py
+4
-8
No files found.
test/test_read_config.py
View file @
57d194d2
...
@@ -28,15 +28,10 @@ http_auth = (user, passwd)
...
@@ -28,15 +28,10 @@ http_auth = (user, passwd)
es
=
elasticsearch
.
Elasticsearch
(
hosts
=
hosts
,
port
=
port
)
es
=
elasticsearch
.
Elasticsearch
(
hosts
=
hosts
,
port
=
port
)
def
write_es
(
target_index
,
platform
=
"short_video"
):
def
write_es
(
Lst
,
target_index
,
target_type
,
platform
=
"short_video"
):
count
=
0
count
=
0
bulk_all_body
=
""
bulk_all_body
=
""
doc_id_type
=
"crawler-data-raw"
header_Lst
=
Lst
[
0
]
if
True
:
if
True
:
dic
=
{
dic
=
{
'platform'
:
'toutiao'
,
'title'
:
'45岁钟汉良Battle战胜王一博,两个细节被疑是暗箱操作?你怎么看'
,
'platform'
:
'toutiao'
,
'title'
:
'45岁钟汉良Battle战胜王一博,两个细节被疑是暗箱操作?你怎么看'
,
...
@@ -77,4 +72,4 @@ def write_es(Lst,target_index,target_type,platform="short_video"):
...
@@ -77,4 +72,4 @@ def write_es(Lst,target_index,target_type,platform="short_video"):
# print(platform, releaser, 'end_have:', len(wirte_set), 'add:', len(set_url))
# print(platform, releaser, 'end_have:', len(wirte_set), 'add:', len(set_url))
write_es
(
"crawler-data-raw"
)
\ No newline at end of file
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