Log: switch both log files to JSONL (one JSON object per line)#31
Merged
Log: switch both log files to JSONL (one JSON object per line)#31
Conversation
3bc198b to
5175584
Compare
Replace pipe/comma-separated text log lines with structured JSON objects (one per line) in commentCleaner.py, PostCleaner.py, weekly_cleanup.py, and web/app.py. Each entry now includes deleted_at, created_at (ISO 8601), id (Reddit fullname), subreddit, score, permalink, body/title, num_comments (posts only), and source field identifying the origin script/mode. https://claude.ai/code/session_014HLhrFtCVRFnEyfRexiy3d
5175584 to
42b28a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces all pipe/comma-separated log writes with
json.dumps()so each entry is a complete, self-describing JSON object on a single line.Why JSONL
,or|break parsingjson.dumpsescapes\nautomaticallydatetimeobject printed (includes microseconds,+00:00)ZsuffixFields in every comment entry
deleted_at,created_at,id(fullname),subreddit,score,permalink,body,sourceFields in every post entry
deleted_at,created_at,id(fullname),subreddit,score,title,permalink,num_comments,sourceExample
{"deleted_at": "2024-01-15T10:30:00Z", "created_at": "2023-06-01T12:00:00Z", "id": "t1_abc123", "subreddit": "python", "score": -2, "permalink": "https://reddit.com/r/python/comments/xyz/...", "body": "The comment text", "source": "ci"}Files changed
commentCleaner.py(modes 1/2/3),PostCleaner.py,weekly_cleanup.py,web/app.pyhttps://claude.ai/code/session_014HLhrFtCVRFnEyfRexiy3d