"...svn:/svn.code.sf.net/p/irrlicht/code/trunk@3628" did not exist on "1300c4df95700516929acf4ab3abbd37d2690a79"
Commit ec6b95da authored by Cody Zacharias's avatar Cody Zacharias Committed by GitHub

Fix ending lag bug

parent 8496ba2c
......@@ -314,6 +314,7 @@ async def outTweet(tweet):
datestamp = tweet.find("a", "tweet-timestamp")["title"].rpartition(" - ")[-1]
d = datetime.datetime.strptime(datestamp, "%d %b %Y")
date = d.strftime("%Y-%m-%d")
if arg.since and arg.until:
if (d.date() - datetime.datetime.strptime(arg.since, "%Y-%m-%d").date()).days == -1:
if _since_def_user:
# mitigation here, maybe find something better
......@@ -676,7 +677,7 @@ async def main():
if arg.limit is not None and num >= int(arg.limit):
break
else:
elif arg.since and arg.until:
while _since < _until:
arg.since = str(_until - datetime.timedelta(days=int(arg.timedelta)))
arg.until = str(_until)
......@@ -695,6 +696,16 @@ async def main():
# Control when we want to stop scraping.
if arg.limit is not None and num >= int(arg.limit):
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:
now = str(datetime.datetime.now())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment