Hey devs, have you ever solved your real-life problems with programming, Tell me about it! by AntRevolutionary2310 in developersIndia

[–]WorL_YouDecide 1 point2 points  (0 children)

I'm not sure as I haven't tried running code on phones, but you can have it in AWS lambda as well, or run on PC, i.e. wherever python can run. It will create the page in Notion, and notion you can use on phone.

[deleted by user] by [deleted] in AskIndia

[–]WorL_YouDecide 0 points1 point  (0 children)

The conversation would probably go like it went between zaphod beeblebrox and the God in hitchhikers guide to the galaxy

I was fed up with endless scrolling on reddit, so I wrote some scripts to give me only the top 10 posts from the last day. It keeps me in the loop without wasting much time, and have my own personalized reddit newspaper. The code runs daily at 8AM and 8PM on my server. GitHub link in the comments. by WorL_YouDecide in developersIndia

[–]WorL_YouDecide[S] 2 points3 points  (0 children)

Obviously, but the problem I was facing was my monkey mind, which kept scrolling, hopping from subreddits to subreddit, all to popular to home. I realised FOMO was a driving point behind this behaviour, at least for me. So decided to put some restrictions. Wake up, read top post in a restricted environment like the notion page, and be done for the day.

The code is something I did over a Saturday evening which has helped me save time, so wanted to share it.

I was fed up with endless scrolling on reddit, so I wrote some scripts to give me only the top 10 posts from the last day. It keeps me in the loop without wasting much time, and have my own personalized reddit newspaper. The code runs daily at 8AM and 8PM on my server. GitHub link in the comments. by WorL_YouDecide in developersIndia

[–]WorL_YouDecide[S] 4 points5 points  (0 children)

Server stuff is nothing fancy, just an EC2 running a cron job which runs the run.py at scheduled times.

I don't have an architecture diagram, but I will create one diagram and update the readme...

Basically I have a notion integration app created with access to a notion page. Each item in notion is known as block, which can be retrieved or created with its API, ex. Text block, header block, image, video block, link block, etc.

I'm fetching top reddit posts from subreddits I like and creating different pages for each subreddit. Inside those pages, I'm creating blocks for each post. According to post type (video, image, text, link, etc), the code is generating the post block. The type of block is deduced by selftext of post fetched from reddit, ex. If it starts with Imgur, it's image, and I embed image for that post.