Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Twint
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Twint
Commits
4baad9c9
Commit
4baad9c9
authored
Sep 27, 2018
by
Francesco Poldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated index and fixes
parent
d4672ee0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
12 deletions
+18
-12
Twint.py
Twint.py
+3
-5
elasticsearch/index-tweets.json
elasticsearch/index-tweets.json
+5
-1
twint/config.py
twint/config.py
+2
-2
twint/storage/elasticsearch.py
twint/storage/elasticsearch.py
+8
-4
No files found.
Twint.py
View file @
4baad9c9
...
...
@@ -207,19 +207,17 @@ def main():
c
=
initialize
(
args
)
if
"likes"
in
str
(
args
.
es_count
):
c
.
ES_count
[
"likes"
]
=
Fals
e
c
.
ES_count
[
"likes"
]
=
Tru
e
if
"replies"
in
str
(
args
.
es_count
):
c
.
ES_count
[
"replies"
]
=
Fals
e
c
.
ES_count
[
"replies"
]
=
Tru
e
if
"retweets"
in
str
(
args
.
es_count
):
c
.
ES_count
[
"retweets"
]
=
Fals
e
c
.
ES_count
[
"retweets"
]
=
Tru
e
if
args
.
pandas_clean
:
twint
.
storage
.
panda
.
clean
()
c
=
initialize
(
args
)
if
args
.
favorites
:
if
args
.
userlist
:
_userlist
=
loadUserList
(
args
.
userlist
,
"favorites"
)
...
...
elasticsearch/index-tweets.json
View file @
4baad9c9
...
...
@@ -19,7 +19,11 @@ PUT twinttweets
"link"
:
{
"type"
:
"text"
},
"retweet"
:
{
"type"
:
"text"
},
"user_rt"
:
{
"type"
:
"text"
},
"essid"
:
{
"type"
:
"keyword"
}
"essid"
:
{
"type"
:
"keyword"
},
"nlikes"
:
{
"type"
:
"integer"
},
"nreplies"
:
{
"type"
:
"integer"
},
"nretweets"
:
{
"type"
:
"integer"
},
"search"
:
{
"type"
:
"text"
}
}
}
}
...
...
twint/config.py
View file @
4baad9c9
...
...
@@ -49,8 +49,8 @@ class Config:
Media
=
False
Replies
=
False
Pandas_clean
=
True
ES_count
=
{
"likes"
:
True
,
"replies"
:
True
,
"retweets"
:
Tru
e
}
Lowercase
=
Fals
e
ES_count
=
{
"likes"
:
False
,
"replies"
:
False
,
"retweets"
:
Fals
e
}
Lowercase
=
Tru
e
Pandas_au
=
True
Proxy_host
=
None
Proxy_port
=
0
...
...
twint/storage/elasticsearch.py
View file @
4baad9c9
...
...
@@ -68,12 +68,16 @@ def Tweet(Tweet, config):
"link"
:
Tweet
.
link
,
"retweet"
:
Tweet
.
retweet
,
"user_rt"
:
Tweet
.
user_rt
,
"essid"
:
config
.
Essid
"essid"
:
config
.
Essid
,
"nlikes"
:
int
(
Tweet
.
likes
),
"nreplies"
:
int
(
Tweet
.
replies
),
"nretweets"
:
int
(
Tweet
.
retweets
),
"search"
:
str
(
config
.
Search
)
}
}
actions
.
append
(
j_data
)
if
config
.
ES_count
[
"likes"
]
is
not
False
:
if
config
.
ES_count
[
"likes"
]:
for
l
in
range
(
int
(
Tweet
.
likes
)):
j_data
=
{
"_index"
:
config
.
Index_tweets
,
...
...
@@ -100,7 +104,7 @@ def Tweet(Tweet, config):
actions
.
append
(
j_data
)
nLikes
+=
1
if
config
.
ES_count
[
"replies"
]
is
not
False
:
if
config
.
ES_count
[
"replies"
]:
for
rep
in
range
(
int
(
Tweet
.
replies
)):
j_data
=
{
"_index"
:
config
.
Index_tweets
,
...
...
@@ -127,7 +131,7 @@ def Tweet(Tweet, config):
actions
.
append
(
j_data
)
nReplies
+=
1
if
config
.
ES_count
[
"retweets"
]
is
not
False
:
if
config
.
ES_count
[
"retweets"
]:
for
ret
in
range
(
int
(
Tweet
.
retweets
)):
j_data
=
{
"_index"
:
config
.
Index_tweets
,
...
...
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