Compare commits

..

No commits in common. "074b8985087bd049cf59eb8c4bc6057bf2e5a273" and "4435f49e17e6c35d08a57d2217eb04dee777df3c" have entirely different histories.

6 changed files with 8 additions and 6 deletions

View File

@ -69,17 +69,19 @@ def iter_comments(flat_comments):
c = make_comment(comment)
indent = comment['depth']
if indent == 0:
if indent == 1:
nested_comments.append(c)
parent_stack = [c]
else:
parent_stack = parent_stack[:indent]
parent_stack = parent_stack[:indent-1]
p = parent_stack[-1]
p['comments'].append(c)
parent_stack.append(c)
return nested_comments
def story(ref):
return False # TODO: remove
r = api(API_ITEM, ref)
if not r:
logging.info('Bad Lobsters API response.')
@ -112,5 +114,5 @@ def story(ref):
if __name__ == '__main__':
#print(feed())
import json
print(json.dumps(story('fzvd1v'), indent=4))
#print(json.dumps(story('ixyv5u'), indent=4))
print(json.dumps(story('fzvd1v')))
#print(story(20802050))

View File

@ -708,8 +708,8 @@ raw-body@2.4.3:
unpipe "1.0.0"
"readability@https://github.com/mozilla/readability":
version "0.5.0"
resolved "https://github.com/mozilla/readability#39a5c5409fb653858b1832141895b882b9092b47"
version "0.4.2"
resolved "https://github.com/mozilla/readability#1d2cb030b32e753cc4b7c4ce8b64c3ce4dc1b2ff"
request-promise-core@1.1.4:
version "1.1.4"