Uptime Robot API (READ DESCRIPTION FOR USAGE INSTRUCTIONS)
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:
from <file name> import Client
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:
client = Client(<your API key here>) # Initiates the client
Step 4: Using the Client cont.
Now, let's actually do something! Type the following code to list how many online monitors you have:
print(client.getAccountDetails()['account']['up_monitors'])
Wow, cool, right?
Step 5: Creating Monitors
Now, let's create a monitor! You know what to do...
client.newMonitor(<name>, <url to monitor>)
Woah! You're becoming an eXpErT HaCkER!
Step 6: Deleting, Pausing, and Resuming Monitors
Deleting, pausing, and resuming monitors is pretty straight forward.
client.<delete, pause, or resume>Monitor(<name>)
Step 7: Changing a Monitor's URL
Now for something different! To change a Monitor's URL, do the following:
client.changeMonitorUrl(<name>, <url>)
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
Isn’t it just easier to go to the website
@Zexogon yeah but isn't it more fun to use this
cmon
@Warhawk947 but the website...
@Zexogon imagine using a web browser instead of curl
and wget
@sugarfi XD how could you even think about it
@Warhawk947 imagine using curl
and wget
rather than compiling a c program with sys/socket.h
whenever you need to access the internet
@Warhawk947 imagine using sys/socket.h
instead of writing raw machine code to access the NIC
@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
@sugarfi AAAAAAAAAAH
What is vanilla python?
Is it like vanilla javascript?
Which is what?
from Warhawk import Client
client = Client("abc123")
client.newMonitor("coder100", "coder100.exe")
while True:
votes += 1
vanilla += 1
howDareYouNotPublishThisOnPyPi += 1
@Coder100 also vanilla python is python with no dependencies, or packages
@Coder100 just like vanilla JS - no external libraries
I thought it was a flavour of Ice Cream @Warhawk947
nope. Install the framework at https://vanilla-js.com @RohilPatel
Oh, I thought u go to vanillaicecream.com @Coder100
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.
@sugarfi woah there buddy
@sugarfi also thanks for upvote
@Warhawk947 no problem, just try to use snake_case
@sugarfi CamelCase is easier tho
@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.
@sugarfi what is PEP
@Warhawk947 Python Enhancement Proposal, basically just a guide for writing good Python
@sugarfi kk cool
me likely
@Kai_Justice yay thankieee