Commit cccc412b authored by Francesco Poldi's avatar Francesco Poldi

Added autoclean

Works for search now
parent 98fa5393
from . import datelock, feed, get, output, verbose
from . import datelock, feed, get, output, verbose, storage
from asyncio import get_event_loop
from datetime import timedelta
from .storage import db
......@@ -16,6 +16,9 @@ class Twint:
self.d = datelock.Set(self.config.Until, self.config.Since)
verbose.Elastic(config.Elasticsearch)
if self.config.Pandas_clean:
storage.panda.clean()
if not self.config.Timedelta:
if (self.d._until - self.d._since).days > 30:
self.config.Timedelta = 30
......@@ -78,7 +81,7 @@ class Twint:
async def main(self):
if self.config.User_id is not None:
self.config.Username = await get.Username(self.config.User_id)
if self.config.TwitterSearch and self.config.Since and self.config.Until:
_days = timedelta(days=int(self.config.Timedelta))
while self.d._since < self.d._until:
......@@ -106,10 +109,10 @@ class Twint:
await self.tweets()
else:
break
if get.Limit(self.config.Limit, self.count):
break
if self.config.Count:
verbose.Count(self.count, self.config.Username)
......
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