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
ec6b95da
Commit
ec6b95da
authored
Apr 29, 2018
by
Cody Zacharias
Committed by
GitHub
Apr 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ending lag bug
parent
8496ba2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
twint.py
twint.py
+16
-5
No files found.
twint.py
View file @
ec6b95da
...
@@ -314,10 +314,11 @@ async def outTweet(tweet):
...
@@ -314,10 +314,11 @@ async def outTweet(tweet):
datestamp
=
tweet
.
find
(
"a"
,
"tweet-timestamp"
)[
"title"
]
.
rpartition
(
" - "
)[
-
1
]
datestamp
=
tweet
.
find
(
"a"
,
"tweet-timestamp"
)[
"title"
]
.
rpartition
(
" - "
)[
-
1
]
d
=
datetime
.
datetime
.
strptime
(
datestamp
,
"
%
d
%
b
%
Y"
)
d
=
datetime
.
datetime
.
strptime
(
datestamp
,
"
%
d
%
b
%
Y"
)
date
=
d
.
strftime
(
"
%
Y-
%
m-
%
d"
)
date
=
d
.
strftime
(
"
%
Y-
%
m-
%
d"
)
if
(
d
.
date
()
-
datetime
.
datetime
.
strptime
(
arg
.
since
,
"
%
Y-
%
m-
%
d"
)
.
date
())
.
days
==
-
1
:
if
arg
.
since
and
arg
.
until
:
if
_since_def_user
:
if
(
d
.
date
()
-
datetime
.
datetime
.
strptime
(
arg
.
since
,
"
%
Y-
%
m-
%
d"
)
.
date
())
.
days
==
-
1
:
# mitigation here, maybe find something better
if
_since_def_user
:
sys
.
exit
(
0
)
# mitigation here, maybe find something better
sys
.
exit
(
0
)
timestamp
=
str
(
datetime
.
timedelta
(
seconds
=
int
(
tweet
.
find
(
"span"
,
"_timestamp"
)[
"data-time"
])))
.
rpartition
(
", "
)[
-
1
]
timestamp
=
str
(
datetime
.
timedelta
(
seconds
=
int
(
tweet
.
find
(
"span"
,
"_timestamp"
)[
"data-time"
])))
.
rpartition
(
", "
)[
-
1
]
t
=
datetime
.
datetime
.
strptime
(
timestamp
,
"
%
H:
%
M:
%
S"
)
t
=
datetime
.
datetime
.
strptime
(
timestamp
,
"
%
H:
%
M:
%
S"
)
time
=
t
.
strftime
(
"
%
H:
%
M:
%
S"
)
time
=
t
.
strftime
(
"
%
H:
%
M:
%
S"
)
...
@@ -676,7 +677,7 @@ async def main():
...
@@ -676,7 +677,7 @@ async def main():
if
arg
.
limit
is
not
None
and
num
>=
int
(
arg
.
limit
):
if
arg
.
limit
is
not
None
and
num
>=
int
(
arg
.
limit
):
break
break
el
se
:
el
if
arg
.
since
and
arg
.
until
:
while
_since
<
_until
:
while
_since
<
_until
:
arg
.
since
=
str
(
_until
-
datetime
.
timedelta
(
days
=
int
(
arg
.
timedelta
)))
arg
.
since
=
str
(
_until
-
datetime
.
timedelta
(
days
=
int
(
arg
.
timedelta
)))
arg
.
until
=
str
(
_until
)
arg
.
until
=
str
(
_until
)
...
@@ -695,6 +696,16 @@ async def main():
...
@@ -695,6 +696,16 @@ async def main():
# Control when we want to stop scraping.
# Control when we want to stop scraping.
if
arg
.
limit
is
not
None
and
num
>=
int
(
arg
.
limit
):
if
arg
.
limit
is
not
None
and
num
>=
int
(
arg
.
limit
):
break
break
else
:
while
True
:
if
len
(
feed
)
>
0
:
feed
,
init
,
count
=
await
getTweets
(
init
)
num
+=
count
else
:
break
if
arg
.
limit
is
not
None
and
num
>=
int
(
arg
.
limit
):
break
if
arg
.
database
:
if
arg
.
database
:
now
=
str
(
datetime
.
datetime
.
now
())
now
=
str
(
datetime
.
datetime
.
now
())
...
...
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