Share your repls and programming experiences

← Back to all posts
ReplTalk Gem
h
CodingCactus

Hi replers!
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.


Set up:

Simply add 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.


Code Snippets

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!

Voters
PixiGem
JacobMcPherson1
darkdarcool
Jakman
piphi
theangryepicbanana
MarcusWeinberger
SudhanshuMishra
Nanowrimoijk
DynamicSquid
Comments
hotnewtop
20092RuthAnggie

But, it is WONDERFUL! Good job

PixiGem

super pog for gems like me :D

JacobMcPherson1

Everything was installing ok, but then I got an error

JacobMcPherson1

Heres the repl btw

CodingCactus

@JacobMcPherson1 your repl appears to work, did you fix it?

JacobMcPherson1

@CodingCactus No, I haven't touched it since I commented. That's strange...

CodingCactus

@JacobMcPherson1 I think it was probably a replit bug then

KPKri

When I click the links, it is showing about:blank thing

darkdarcool

Kewl!!

CodingCactus

@darkdarcool if that's just some dodgy spelling of "cool" then thanks!

darkdarcool

@CodingCactus
(yes it is), and np!

Jakman

Nice. Very nice.

CodingCactus

Thank. Very thank

20092RuthAnggie

I can't understand yours

darkdarcool

This is really kewl!!

[deleted]

Finally since im banned i delete my accunt and re do it again so pls dont report me AND THIS IS NOT ADVERTISHING THIS IS A NOTE TO YOU GUYS.

CodingCactus

@jason37 pardon?

[deleted]

@CodingCactus ahh pls dont do it

Whippingdot

awwwww why is it ruby

CodingCactus

@Whippingdot so that it can be good

Whippingdot

make it in elixir too or smthing. Ima learn elixir in the future so...please @CodingCactus

CodingCactus

@Whippingdot well maybe when you're learning elixir, you can make it as a learning exercise

Whippingdot

🤦‍♀️ fine it is actually good for me as I will be more experienced in elixir if I try converting it. Anyway good proj even though I haven't tried it @CodingCactus

zplusfour

awesome!
saw that on github before :D

CodingCactus

@zplusfour haha nice

zplusfour
JacobMcPherson1

e

RayhanADev

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!

CodingCactus

I feel that's targeted at someone xD

@RayhanADev yeah i saw someone made a post the other day which used web scraping was super slow and stuff, can't remember who, and i just wanted to make sure people new it was a proper api wrapper.

CodingCactus

I was wondering when there might be a ReplTalk post for this

@RayhanADev I wasn't sure if rt would appreciate it, its a bit of a deviation from the standard python console/html games

RayhanADev

@CodingCactus lol true, true I just don't really post to repltalk either unless it's a game because nobody ever cares about it so i guess I feel you in some aspect

ch1ck3n

@CodingCactus whats the post
can i see

RayhanADev

@ch1ck3n jb and dark (and technically you too)'s module before I came and helped ya'll with graphql lol

ch1ck3n

@RayhanADev i started it with graphql excuse me

RayhanADev

@ch1ck3n ah but I was the one who actually added the request and query so ya'll could use it

ch1ck3n

@RayhanADev i was the one who added the whole base of the module and classes and fields

RayhanADev

@ch1ck3n okay ƪ(˘⌣˘)ʃ then you did it and you did it well because the module is awesome :)

ch1ck3n

@RayhanADev it doesn't use async madness

CodingCactus

@RayhanADev I don't speak American, but I believe you are supposed to say "y'all" not "ya'll" as it is "you all" not "ya will" 🤣

CodingCactus

i was the one who added the whole base of the module and classes and fields

@ch1ck3n was it you that I gave them all to?

ch1ck3n

@CodingCactus ok fine

i made the program function better than just a billion different functions

RayhanADev

@CodingCactus

I don't speak American, but I believe you are supposed to say "y'all" not "ya'll" as it is "you all" not "ya will" 🤣

hahahahaha maybe, but I live in Texas not America there's obviously a difference and like everything we think we're so special so it's ya'll xD

IGamer123

pog @CodingCactus 👍🏼

CodingCactus

thanks @IGamer123

JWZ6

dis pog alright

CodingCactus

@JWZ6 lol ty

JWZ6
ch1ck3n

hi i was using my repltalk client and saw this lol

CodingCactus

@ch1ck3n oh nice, what features does it have

ch1ck3n

@CodingCactus eh i just started working on it yesterday
https://jam-1-replapi-project.ch1ck3n.repl.co/
it takes a while to load

all i can do is view the hot posts (for now) :D

CodingCactus

@ch1ck3n nice, what are you using for it to take so long?

ch1ck3n

@CodingCactus your api lol

ch1ck3n

@ch1ck3n *your python api

ch1ck3n

@CodingCactus OH MY GOD it had en error (i fixed it now it should load)

CodingCactus

@ch1ck3n the one made by mat?

ch1ck3n

@CodingCactus slps head im stupid yes the one made by mat

CodingCactus

@ch1ck3n hm it still shouldn't be that slow, I'll take a look to see where the efficiency is dying

ch1ck3n

@CodingCactus o thanks

CodingCactus

@ch1ck3n you're using REPLAPI which is not https://github.com/mat-1/repl-talk-api

ch1ck3n

@CodingCactus i'm currently not usnig that one, if you look in jam/repl.py I'm using mat's api

CodingCactus

@ch1ck3n oh ok whoops

CodingCactus

@ch1ck3n yeah it looks like it is just his module being slow which is odd. My one for ruby is a lot faster, I'll take a look at the actual module code I'm not sure why it is so slow

ch1ck3n

@CodingCactus thank you! :)

Bunnytoes

this is cool

CodingCactus

@Bunnytoes thank you very much, it took quite some time to make!

Bunnytoes

@CodingCactus well it payed off!

UnluckyFroggy

@CodingCactus nice work

CodingCactus

@Bunnytoes haha yeah it sure did! I use if for https://github.com/Coding-Cactus/ReplTalk-Bot and lots more

0bE

@CodingCactus Hey that's pretty cool!