Commit 8030b30e authored by Francesco Poldi's avatar Francesco Poldi

Adding Store_object to store tweets (in ram)

parent 1dc9e9a9
......@@ -34,3 +34,4 @@ class Config:
TwitterSearch = False
User_full = False
Profile_full = False
Store_object = False
......@@ -4,6 +4,8 @@ from . import db, elasticsearch, format, write
from .tweet import Tweet
from .user import User
tweets_object = []
def datecheck(datestamp, config):
if config.Since and config.Until:
d = int(datestamp.replace("-", ""))
......@@ -29,7 +31,13 @@ def _output(obj, output, config):
write.Text(output, config.Output)
if config.Elasticsearch:
if config.Store_object:
tweets_object.append(tweet)
else:
print(output, end=".", flush=True)
else:
if config.Store_object:
tweets_object.append(tweet)
else:
print(output)
......
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