Tempaste can be used to get any information live on the internet quickly, and is especially useful when this information becomes outdated or irrelevant quickly. Using the built in API, we can connect to Tempaste automatically and upload any information that our system has to give out.
Let's build a service status system that updates automatically and that is hosted away from your own servers so that it'll stay up even if your services go down.
To start, let's create a new account with a username that relates to our app.
Now we've got a listing page that'll always stay up to date on the latest posts we make, making this the page we should share publicly.
As we'll be making good use of the API, we'll need an API key. Create a new one called myAmazingApp on the API part of your dashboard and make sure to give it all of the available permissions. Copy the key and we've got everything we need.
Return to your app and add your API key to the correct variable. Now set up your app to make POST requests to the correct URL. You can see all of the endpoints and options on https://tempaste.com/api . Choose the markdown content type option as that'll be the easiest for us to work with for this.
For this project, we're going to need one new page on Tempaste for every day's worth of service status updates. Which means that we'll initially need to create the page at the start of the day, then update it throughout the day to report on anything that's going wrong.
Let's start by standardizing our page titles. We'll go with 'myAmazingApp Status [DAY] [MONTH] [YEAR]'. This way we'll always be able to recreate the title and update any of the posts without needing to store the paste IDs here on our app.
At the start of each day, we'll create a new post with the title following the rule we just created. As myAmazingApp has four different services, we'll need to speak about them all in turn. Let's start by checking the current status of each.
We'll assume for now that everything is running smoothly at the start of the day. Let's add in that information and add this to the initial post information:
**SERVICE 1: 🟢** No issues or downtime reported today. 6am GMT - Service under heavy load, slower response times 3.05am GMT Service normal 3am GMT - Service offline **SERVICE 2: 🟢** No issues or downtime reported today. **SERVICE 3: 🟢** No issues or downtime reported today. **SERVICE 4: 🟢** No issues or downtime reported today.
Now, we'll simply be regularly checking our service for issues and checking the Tempaste page for any difference in information.
Now that everything is going right, let's add in a handler for when it goes wrong. Service 1 just went down and it's 3am. Let's check the Tempaste page and see what it says for service 1: green light. All we'll need to do is replace that with a red light emoji and add an entry underneath it with the time and the situation.
Checking again at 3.05AM, we can see that everything is back to normal. We'll again replace that red circle emoji with a green one and add another line underneath Service1 to say that everything is back to normal.
Just for good measure, at 6am we spot that the service is under heavy load so let's add a line for that as well.
And with that, we're done! This system will now keep an automatic log of your service statuses, hosted away from your own systems and will automatically remove older posts after a set number of days to prevent clutter from outdated information.