Today I present you with a super duper easy way to interact with repltalk using code. Using none of that horrible web scraping or anything, it uses the proper api endpoint that most of replit uses aka replit.com/graphql!
It's for Ruby, so if you don't already know Ruby, make sure to learn it, it's amazing!
I have added every general user query and mutation (that I could find) so you can do pretty much anything you want to.
gem "repltalk" to your Gemfile and add
require "repltalk" to the top of your main.rb (or whatever file you are using it in).
Next you need to initialize the client which is also super simple. All you need to do is add
client = ReplTalk::Client.new to your main.rb.
You can do so many things with this, here are only a few of possibly unlimited examples.
Get CodingCactus' posts from the top 100 posts:
Get the 10 most recent ruby post's URLs
See how many people have forked CodingCactus' classrooms repl
See how many comments in a post mention CodingCactus
See what position CodingCactus is in the all time leaderboard
See how many repls of each language CodingCactus has
If you want to see it in action, check out https://github.com/Coding-Cactus/ReplTalk-Bot
To see the full documentation check out the GitHub repo: https://github.com/Coding-Cactus/repltalk
Suggest any new queries to be added in an issue, or even add it yourself and make a pull request.
And don't forget to star! : )
I hope you all like this lol, I certainly do! I learnt so much from making it: Ruby, GQL etc.
Thanks, cya next time!
Beautiful, I was wondering when there might be a ReplTalk post for this :)
Using none of that horrible web scraping or anything
I feel that's targeted at someone xD, you know what I think I'll make a post for my Replit API after it's refactored. Anyways, good luck with your Gem it's very nice!