Share your repls and programming experiences

← Back to all posts
Uptime Robot API (READ DESCRIPTION FOR USAGE INSTRUCTIONS)
Warhawk947

How this all came together

So, If you're like me, and you use the Repl.it Way of hosting discord bots, you use uptimerobot.com to track how your bots are doing.

Which is ok, but, well, you kind of have to type out "uptimerobot.com" in the search bar every single time you want to check on your bots.

Which is ok, but pretty soon you'll reduce your fingers into painful stubs because of overtyping.

Which is ok, but if you're like me and you bring your computer to school, you'll soon see that every single time you switch IP addresses, you'll have to re-login.

Which is ok, but pretty soon you'll start thinking of a better way.

And thats how UptimeRobotAPI was created - All in Vanilla Python!.

Usage Instructions

Step 1: A journey of a million miles begins with one step

Copy the entire contents of "main.py" into a file of your choosing. Then in your "main.py", to import the API, type the following:

Step 2: Initiating the client

Next, to create the client, you'll have to get your API secret. Ooh, Scary!

Step 2.5

To get your API key, first go to uptimerobot.com. Then, go to your settings. Then, scroll all the way down until you see the header "API Settings". Go down to the sub-header "Main API Key" and click create the main API key, and then copy to clipboard

Step 3: Using the Client

After you got the API key in your clipboard, type the following:

Step 4: Using the Client cont.

Now, let's actually do something! Type the following code to list how many online monitors you have:

Wow, cool, right?

Step 5: Creating Monitors

Now, let's create a monitor! You know what to do...

Woah! You're becoming an eXpErT HaCkER!

Step 6: Deleting, Pausing, and Resuming Monitors

Deleting, pausing, and resuming monitors is pretty straight forward.

Step 7: Changing a Monitor's URL

Now for something different! To change a Monitor's URL, do the following:

Simple, right?

Congratulations! You've learned everything about my UptimeRobotAPI! WOOHOO!!!!!!!!!!!!!!!!

Btw, I'll be making a discord bot with all of these features (and more!), so stay tuned!

OMG guys, thanks for the upvotes \(OwO)/

cheers, Warhawk947

Voters
Yek
Warhawk947
DeBeast591
realWumpus
MarcusWeinberger
Coder100
UniqueOstrich18
CodeSalvageON
sugarfi
Foster_Bryant
Comments
hotnewtop
Kai_Justice

me likely

Warhawk947

@Kai_Justice yay thankieee

Dart

Isn’t it just easier to go to the website

Warhawk947

@Zexogon yeah but isn't it more fun to use this
cmon

Dart

@Warhawk947 but the website...

sugarfi

@Zexogon imagine using a web browser instead of curl and wget

Warhawk947

@sugarfi XD how could you even think about it

sugarfi

@Warhawk947 imagine using curl and wget rather than compiling a c program with sys/socket.h whenever you need to access the internet

sugarfi

@Warhawk947 imagine using sys/socket.h instead of writing raw machine code to access the NIC

sugarfi

@Warhawk947 imagine writing machine code instead of building an NIC and hooking it up to your computer which you build from scratch and program with a magnetized needle

Warhawk947

@sugarfi AAAAAAAAAAH

Coder100

What is vanilla python?
Is it like vanilla javascript?
Which is what?

Warhawk947
Warhawk947

@Coder100 also vanilla python is python with no dependencies, or packages

sugarfi

@Coder100 just like vanilla JS - no external libraries

Warhawk947
RohilPatel

I thought it was a flavour of Ice Cream @Warhawk947

Coder100

nope. Install the framework at https://vanilla-js.com @RohilPatel

RohilPatel

Oh, I thought u go to vanillaicecream.com @Coder100

Warhawk947
hugobasq

How do you get for example the average response time of a monitor?

sugarfi

don't use camelCase in python! NEVER CAMELCASE! I REPEAT: NEVER USE CAMELCASE IN A PYTHON PROGRAM! CAMELCASE IS NOT FOR PYTHON! NEVER DO THIS! cool project, by the way.

Warhawk947

@sugarfi woah there buddy

Warhawk947

@sugarfi also thanks for upvote

sugarfi

@Warhawk947 no problem, just try to use snake_case

Dart

@sugarfi CamelCase is easier tho

sugarfi

@Zexogon but you don't use it in python.
From PEP 8:

Function names should be lowercase, with words separated by underscores as necessary to improve readability.

Variable names follow the same convention as function names.

mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.

Warhawk947

@sugarfi what is PEP

sugarfi

@Warhawk947 Python Enhancement Proposal, basically just a guide for writing good Python

Warhawk947

@sugarfi kk cool