Share your repls and programming experiences

← Back to all posts
πŸ“ Replit Talk Post Fetcher
eankeen (661)

πŸ“ Replit Talk Post Fetcher

What it does

If you're into helping other people in repl.it, you may be continuously checking replit talk for recently asked questions.

Sometimes refreshing the page burns one too many calories. Or, you're worried you'll get arthritis by clicking too much.

Either way, you can use this repl, which gets new posts from https://repl.it/talk/ask?order=new. After getting the post data, it creates a neat 'dashboard' page like below πŸ‘‡

This GIF demonstrates how quickly the data can be fetched. However, when using this please only check for updates ever 15 seconds. Notice the appearance of the yellow div

Notice in the GIF below, the total comments in the yellow div increases to 1, then to 2. Props to @nithilan4 for helping me show this.

πŸ’› Yellow elements represent new posts (less than an hour old)
πŸ’šGreen elements represent answered posts
πŸ’œ Links to posts turn purple after you click on them

If an element is new and has been answered, it will appear green, rather than yellow.

How I made it

I chose to not rely on any external modules or libraries when creating this application. The server is a simple NodeJS HTTP server. As for JavaScript running on the client, I wrote everything up in VanillaJS.

Thank you for your time, and I hope you found this repl useful πŸ˜„!

Commentshotnewtop
amasad (1416)

This could be a mobile app!!

eankeen (661)

@amasad Yeah that could be cool! Do you guys have some delegated authorization flow etc. setup that this potential app can leverage? So it can post on behalf of user.

mkhoi (197)

This is very helpful! πŸ‘

Steven_The_GuyT (202)

Whenever I open it up, it displays a blank screen with the title, but no repls.

eankeen (661)

@Steven_The_GuyT Oh no! Lemmie see if I can fix it

Steven_The_GuyT (202)

Wait, @eankeen, whenever a question was like 61 minutes ago, the program says the question was 2 hours ago. Like whenever a question gets to be more than 60 minutes old, the repl displays the age as one hour older than it should be.

eankeen (661)

@Steven_The_GuyT πŸ€” Hmm. I understand the actual time it displayed is incorrect, but I just want it to match the time displayed on replit talk. And I think it does match? :P

eankeen (661)

@Steven_The_GuyT If you want to change it, you can go to the util.js file and change those Math.ceil() calls to Math.floor() or Math.round() Heck, you may not even want to round :)

EthanJustice (70)

Really like the UI! Looks a lot like Reddit too!

Steven_The_GuyT (202)

This is super useful! Thank you!

mat1 (2506)

You should make it work as a PWA!

eankeen (661)

@mat1 Yeah I thought about doing that! Didn't feel like it was absolutely necessary though.