|
|
@ -22,8 +22,7 @@ def parse_timeline(data):
|
|
|
|
def parse_entry(entry):
|
|
|
|
def parse_entry(entry):
|
|
|
|
result = []
|
|
|
|
result = []
|
|
|
|
entry_id = entry["entryId"]
|
|
|
|
entry_id = entry["entryId"]
|
|
|
|
if "promoted" in entry_id:
|
|
|
|
if "promoted" in entry_id: return []
|
|
|
|
return []
|
|
|
|
|
|
|
|
elif ("list-conversation" in entry_id or "conversationthread" in entry_id \
|
|
|
|
elif ("list-conversation" in entry_id or "conversationthread" in entry_id \
|
|
|
|
and not "tweet" in entry_id):
|
|
|
|
and not "tweet" in entry_id):
|
|
|
|
for item in entry["content"]["items"]:
|
|
|
|
for item in entry["content"]["items"]:
|
|
|
@ -183,5 +182,6 @@ def parse_detail(data):
|
|
|
|
logger.error(f"Error when parsing entry: {e} {e.args}")
|
|
|
|
logger.error(f"Error when parsing entry: {e} {e.args}")
|
|
|
|
logger.error(f"\n{traceback.format_exc()}")
|
|
|
|
logger.error(f"\n{traceback.format_exc()}")
|
|
|
|
logger.error(f"\n{pformat(entry)}")
|
|
|
|
logger.error(f"\n{pformat(entry)}")
|
|
|
|
|
|
|
|
result = [r for r in result if not r["screen_name"] in ["premium"]]
|
|
|
|
result.sort(key=lambda x: x["timestamp"])
|
|
|
|
result.sort(key=lambda x: x["timestamp"])
|
|
|
|
return result
|
|
|
|
return result
|