Learn to Code via Tutorials on Repl.it!

← Back to all posts
How to Make a Repl.it Cycles Notification (Apple Tutorial!!!)
h
RayhanADev

Hello people, been a while since I was last here (actually it was literally last year) but I thought I should make a proper leave. If you are interested in why, I left a small piece at the bottom about it, but without further adu:

How to Make A Repl.it Cycles Notification (Apple)

Getting Started

This is an Apple shortcut that will get information about your Repl.it Cycles with a simple tap! To start navigate to the Shortcuts App on your Apple Device.

Next up, create a new shortcut by hitting the plus button in the top-left of your screen:


Writing the Web Request

In this part, we will be getting the our cycle data from the Repl.it API. Now in your new shortcut's editor (this screen below where you drag-and-drop blocks) click into the Web tab.

In the Web tab, scroll down until you find the "Web Requests" section. When you're there, click on and add in a Get Contents of URL block.
]

Once you have added in your first block, you are ready to write the Web Request! First off, change the url in variable box to https://staging.repl.it/graphql.

Next hit the dropdown button to open up the contents of your block. We will be using the POST method (you don't really need to know how it works but Google it if interested!) to get our data so choose the POST option.

Now that we have our block in the POST method, we can write the Request Body. This contains what we are asking the API. To start, confirm that Request Body is in JSON format and then add a Text field.

Okay now we will add in all the necessary fields. Open up the Headers tab if you cannot see it already and add in the following Text fields.
Headers:
| X-Requested-With | Referrer |
| :-----: | :-----: |
| Literally Anything | https://repl.it/ |

Request Body:
| query |
| :-----: |
| { userByUsername{username: "your username in here" { karma } } } |

° Please refer to this image below if you have questions about everything's position! It may sound confusing, but a picture is worth a thousand words.

Sluicing our Variable

Great you made it this far, so give yourself a pat on the back uwu! Now it is time to get our variable out of the response. The JSON that we get in response has our cycles hidden inside, but Apple Shortcuts has no quick way to get it out. Good thing is, the method I show you is easy! Click into the Scripting tab to get started.

Once here, scroll down until you reach the "Variables" section. Then add in a Set Variable block.

Once you added your block, in the first box type data. Then pay close attention here. Click on the second box, and you should get a tab like in the image below. In that tab, click the variable format button (the "as _" button).

When clicked, scroll (up or down) until you find the "Dictionary" option. Choose the "Dictionary" Option.

After that you will be taken back to the tab. Once here click the new "Get Value for Key" button.

When you are prompted, set the value to data.

And tada! No sweat. Now you just have to repeat this two more times and that finishes the complicated part. Use these values for the rest:
| Block # | Variable Name | Value for Key |
| :-----: | :-----: | :-----: |
| 2 | userByUsername | userByUsername |
| 3 | cycles | karma |

Fun fact, the Repl.it API calls cycles karma, like Reddit! xD

Creating the Alert

Last leg of this program, you can make it! Still in the Scripting tab, scroll until you find the "Notification" section. From there, add in a Show Alert block.

Now change the box value to the "cycles" variable you previously created! If you want to, you can precede this value with Cycles: or anything you really want!

And that should be it! Test it out by clicking the Play button in the to-right corner, and you should get and alert like the one below.

And yay! If it works, you can click the three dots button at the top center. From here, you can customize how your app looks, if it is in the share sheet, and if it is on your homepage!

Congratulations!

You made your own Repl.it Cycles Notifications App, good job! If you are interested in things like this, feel free to go learn about the Repl.it GraphQL API.

About Me

So yeah, I kinda disappeared after December. Sorry ƪ(˘⌣˘)ʃ! I kinda (and still am) cramming for diagnostics, upcoming AP exams, and finals so I shifted my focus onto them for the time being. Still love the Repl.it community and miss ya'll a lot (although I can't say the same about the new redesigning...)! I'll will be back hopefully soon, but in the meantime I'm probably going to be inactive in the community. So um:


Voters
icelite
chillcafe
ryanbrwr
BananaJellyfish
Chewyblockguy
gerego
Martinalud
dantheman786
21natzil
AxolotlBot
Comments
hotnewtop
FlaminHotValdez

Ayy! Nice to know our resident pogfurret isn't leaving for good.

RayhanADev
ch1ck3n

A new block coding language, yipee!

Bookie0

It’s pretty cool, but why would you want to get updates when you get more cycles? Notifications, I would understand, but useless internet points?

I knew the good thing is you use Apple! :)

RayhanADev

@Bookie0 :D well not updates (I'd hate that xd) just a clickable to see how much you have!

Bookie0

@RayhanADev oh ok not updates lol, but i mean you could just log on to repl.it to find the number of cycles (not that you'd need to) :)

ItamarCohen28

I saw your ric-roll on how to use markdown :)

@Bookie0

Bookie0
FloCal35

Ew light mode

My eyeeeeeeeees

RayhanADev

@FloCal35 sowwy, also when did Repl.it get Dark Theme (^ヮ^)/

JBloves27

Yeeeeessss xd @RayhanADev

JBloves27

Hahahaha xd @FloCal35

Kookiez

@RayhanADev It's probably an explorer thing, if you dare to want light mode, I think you have to disable explorer

FloCal35

Ikr @RayhanADev, they updated it recently (actually right before I saw this post)

FlaminHotValdez

@RayhanADev enable explorer mode. It's only available to explorers, but anybody can become an explorers, go to edit your profile, roles, then click the box next to explorer to enable it.

Whippingdot

Wait what. Dark mode is there. MY EYES. WHEN DID THAT HAPPEN. WHY AM I USING TAMPERMONKEY YOU * WHY DID YOU TRICK ME @FlaminHotValdez

Whippingdot

I LOVE DARK MODE ♥♥♥♥♥♥♥♥♥ but I think my own css might be better @FlaminHotValdez

Whippingdot

Na I think dark mode is better. I will have my css in the morning and after 3 it is dark mode time @FlaminHotValdez

Crosis

@RayhanADev How would I do this in NodeJS?

RayhanADev

@FlaminHotValdez I'm already an explorer, that's why i asked (⁄ ⁄>⁄ ▽ ⁄<⁄ ⁄)

RayhanADev

@Crosis hmmm, prolly go through my older tutorials till you find the GraphQL tutorials I made!

Crosis

@RayhanADev Ok, will do!

Crosis

@RayhanADev Also, you should update the link in the tutorials from https://repl.it/graphql to https://staging.repl.it/graphql as I am pretty sure it is not working with the first one

Whippingdot

U seem to be ignoring me 😭😭 @RayhanADev

Crosis

@RayhanADev Sorry for ping, but Repl just added always on repls! and thanks for the info, with your help I was able to add cycles to my chat! Tysm!

Whippingdot

Wait a sec when did they add always on repls. I don't see it in the pricing. It still says coming soon @Crosis

FlaminHotValdez

@Whippingdot bruh it literally came out yesterday don't kill me

Whippingdot

But where does it say that and how do you know? @FlaminHotValdez

FlaminHotValdez

@Whippingdot because there were a bunch of ask posts saying Why isn't this working with dark mode on and I'm like say what?

Whippingdot

I know dark mode is on, I asked how do you know always on repls are there @FlaminHotValdez

FlaminHotValdez

@Whippingdot I don't know I don't have hacker

Whippingdot

uuu i invite you to repl and give you code tomorrow?(IT IS FREAKING 11 FOR ME MY PARENTS ARE GOING TO MURDER ME I ALSO HAVE A FREAKING EXAM) @FlaminHotValdez

Crosis
FlaminHotValdez

@Whippingdot now it's 12 ;)

Whippingdot

I was in my bed by then 😁 @FlaminHotValdez

Whippingdot

Now I woke up feeling great drinking holy water - Lil Mosey in the song 'Holy Water' @FlaminHotValdez

Whippingdot

oke doke really sorry but @amasad I don't know who to ping as moderation doesn't work. the pricing page on repl.it still says coming soon for always on repls so I think you should change it @Crosis

FlaminHotValdez
tussiez

Enjoy your Cycles Karma

RayhanADev
ch1ck3n

I tried to use it with python and this happened:
POST body missing. Did you forget use body-parser middleware?

this is my code

Chewyblockguy

oh wow this seems easy enough. 5 hours later how the heck do I do this!!! lol

PYer

Uh I'm pretty confident I created a post like this before you. And then this gets in the newsletter... :| However, it is different + shorter, so great job still

RayhanADev

@PYer oop yeah I just saw yours xD (I like how yours allows users to look up anyone :D)

PYer

thanks @RayhanADev

LamonteFisher

WOW, that's a lot.

FloCal35

Congrats on your Repl.it newsletter mention. This is still not working for me even though I've done everything it said

DungeonMaster00

but Google it if interested

no search it on duckduckgo instead

RayhanADev

FYI

if it says something like

Cycles:

when you run this, then change the url from https://staging.repl.it/graphql to https://repl.it/graphql

angrydoge

was is dis symbol "
"

RayhanADev

@angrydoge better apostrophes

angrydoge
zplusfour

rip android users ;-;

RayhanADev

@zplusfour yes sorry xD I'm sure there is something for Android i don't know ƪ(˘⌣˘)ʃ

zplusfour

@RayhanADev yeah probably

Whippingdot

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO Y U LEAVE YOU WERE MY FIRST FRIEND ON REPL.IT, YOU INTRODUCED ME TO @TsunamiOrSumth, and you joined one month before me. EXACTLY. WHYYYYYYYYYYYY GOD WHYYYYY BTW do you want to join the org for repl.it coders? I know you are leaving but...

angrydoge

;_; wtf @Whippingdot

Whippingdot

I shud ask that q to you @angrydoge

angrydoge

ARE YOU OK @Whippingdot

Whippingdot

Again, i shud ask that question to you @angrydoge

angrydoge
Whippingdot

I SAID YOOOOOUUUUUUUUUUUUU @angrydoge

angrydoge
Whippingdot
i am pettty suuur u...but maybe @angrydoge
angrydoge
RayhanADev

@Whippingdot @angrydoge whaaa ( -.-)

angrydoge

Ight im coding so no pong plz. @RayhanADev

Whippingdot

WHY CAN'T I PLAY PONG STOP SAYING NO PONG PLZ @angrydoge

I SAID U ALREADY UUUUUUUUGGGGGGHHHHHH!! @angrydoge


@RayanADev YAAAAAAAAAAAAAAAAAAAAAA

angrydoge

YOU JUST PINGED ME THREE TIMES STOP @Whippingdot

Whippingdot

Shud i reply to this...or no
😁 @angrydoge

angrydoge

EEEEEEEEEEE @Whippingdot

FlaminHotValdez

@Whippingdot Check out my comment he's only temporarily leaving until his exams/APs are over(thankfully). If he were really leaving I'm 99.9% sure the community would throw a GOODBYE RAY party lol

Whippingdot

Oh yea just realized. Also grining his teeth together RAY YOU TRICK MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE @FlaminHotValdez

FlaminHotValdez

@Whippingdot he didn't...at the bottom he explains. Also go to bed it's like 10 pm for you right

Whippingdot

how do you know also i have a math exam tomorrow 😁😁😁 i am preparing for it and checking this once in 10 mins @FlaminHotValdez

FlaminHotValdez

@Whippingdot xD you're in IST time which is more or less 13 hours ahead of me, and then it was around 8 30 so I roughguessed

Codemonkey51

oh hai

RayhanADev
Codemonkey51
TsunamiOrSumth

woaw

Whippingdot

right... @TsunamiOrSumth

JBloves27

Niccee! Thanks sooo much! :D

Whippingdot

Your welcome boss @JBYT27

RayhanADev

@JBYT27 no problem m8!

JBloves27
JBloves27
RhinoRunner

FloCal35
RayhanADev

@RhinoRunner hmmm, can you show me your wWeb Request block?

JBloves27

Er yeah, same @RayhanADev

Whippingdot

Oh, that is because you aren't exercising. GO CYCLE @RhinoRunner

RayhanADev

@JBYT27 hrmmm weird lemme check something in the tutorial then.

RhinoRunner

@Whippingdot boi i have more cycle than you
OK, will do

Whippingdot

I only have 1 cycle i guess. How many bicyles can a man have? @RhinoRunner

RhinoRunner

@Whippingdot oh you mean bikes
i have .9 of them

IntellectualGuy

Me: cries in no iphone
Make a tutorials for windows please

programmeruser

@IntellectualGuy you can probably create something with HTML/CSS/JS or IFTTT

IntellectualGuy

@programmeruser What's IFTTT? And how would I use HTML/CSS/JS for it?

programmeruser

@IntellectualGuy create a proxy tat sets the right headers, and use the Notification API. IFTTT

IntellectualGuy

@programmeruser I know like 0 JavaScript, so I probably won't be able to do that.

Whippingdot

'IFTTT' is 'PFTTT' @IntellectualGuy

angrydoge

The interface reminds me of IFTTT

tussiez

@angrydoge I agree

Whippingdot

But I don't, it reminds me of 'PFTTT' @tussiez

tussiez

@Whippingdot I set up IFTTT to email me when it snows or gets cold and it's been spamming me for a year

angrydoge

XDDD @tussiez

Whippingdot

y u tell me but LOOOOL @tussiez

tussiez
Whippingdot
angrydoge

STOP PONG @Whippingdot

tussiez
Whippingdot
Whippingdot

Sorry but i like playing pong @angrydoge

tussiez

@Whippingdot big boy image

Whippingdot

how u reeduce @tussiez

tussiez

@Whippingdot haha self promo? https://qimage.tussiez.repl.co dunno if it still works tho

angrydoge

STOP PINGING MEE @Whippingdot

Coder100

cool!
but why staging subdomain?

RayhanADev

@Coder100 so that the https://repl.it/graphql page doesn't die when someone spams it. Staging is kinda like what you use for everything non-user related imo.

Coder100

lol what @RayhanADev

RayhanADev

@Coder100 cloudflare

programmeruser

@RayhanADev it's possible to bypass cloudflare

RayhanADev

@programmeruser exsqueze me wha? explain pls <(_ _*)>

RayhanADev

🍎 for the win!

Kookiez

@RayhanADev Nah, only iPhones and iPads are ok, but Macs aren't good

tussiez
xxpertHacker

@Kookiez Honestly, I hate how restricted iPhones are, I can't execute unsigned native, executable, code on RAM. Also, they're fairly useless without being jailbroken.

RayhanADev

@Kookiez @tussiez yep, agreed. Also Airpods aren't tooo bad (but those Maxes though smh)
@xxpertHacker well yeah, but for someone who uses an iPhoen for everything besides that, it does more than well :D

tussiez

@RayhanADev
I can't afford any of their products -_(..)/-

tussiez

@RayhanADev @Kookiez
There is one thing they do well: profit

xxpertHacker

@RayhanADev Okay, Airpods are good, their tech like that is good, but anything that runs on their own OS (e.g. iPhone, MacOS), I dislike.

...for everything besides that...

For what?

FloCal35

@Kookiez Bookie0 won't be happy you don't like macs (I won't ping him)

IntellectualGuy

@FloCal35 Lol I was about to say the same thing

Whippingdot

BUT I WILL HAHAHAHAHAHAHA @Bookie0 @FloCal35

FloCal35
Bookie0
Whippingdot

😈😈😈😈 @FloCal35

Whippingdot

lol check the thread @Bookie0

programmeruser

@RayhanADev they won't even let you access the filesystem.
You can't do anything without a jailbreak.

RayhanADev

@programmeruser yea, but I really don't plan on jailbreaking any Apple devices, it's kinda pointless to mess with a phone?

FlaminHotValdez

@RayhanADev I know this is a dead thread but my name is Max(I changed my username from @maxyang to @FlaminHotValdez) bc it showed my real name...

me is insulted