Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/models/Reddit data streaming.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "c57a2212-8c2b-413f-becf-ecc57e62717b",
"metadata": {
"scrolled": true
Expand Down Expand Up @@ -231,8 +231,8 @@
" print(f\"🚨 Saved {len(detected_posts)} posts. Ready for classification.\")\n",
"\n",
" time.sleep(2) # Avoid hitting API rate limits\n",
"print(f\"/nchecked all last 10posts/n\")\n",
"print(f\"/nchecking real-time data/n\")\n",
"print(f\"Checked all last 10posts\\n\")\n",
"print(f\"Checking real-time data\\n\")\n",
"\n",
"for post in subreddit.stream.submissions(skip_existing=True):\n",
" title = post.title.lower()\n",
Expand Down Expand Up @@ -267,7 +267,7 @@
" print(detected_posts)\n",
"\n",
" # Send every 5 posts to the classifier\n",
" if len(detected_posts) % 1 == 0:\n",
" if len(detected_posts) % 5 == 0:\n",
" with open(\"detected_posts.json\", \"w\") as f:\n",
" json.dump(detected_posts, f, indent=4)\n",
" print(f\"🚨 Saved {len(detected_posts)} posts. Ready for classification.\")\n",
Expand Down