There is this handy little Mac OS Tool which can connect to API endpoints to show you things like twitter follower counts. It sits in your menu bar and refreshes from time to time. So why not use this tool, to show the number of pending comments you received?
We'll use that functionality to show the number of pending comments like so:
First of all, we have to tell Kirby to allow us to use Basic Auth to connect to the API. By default it uses session auth which won't work for our use case. So we have to open our config file
site/config.php and add the following:
'api' => [ 'basicAuth' => true ]
This way we are able to connect to the Kirby Rest API with our user credentials. It might be a good idea to create a new user used exclusively for API calls. You may also add a role for that user. If you would like to know more about that topic, please have a look at the official Kirby documentation.
We should now be able to access the API Endpoint to get the pending comments which is:
So, let's open Radar and add a new entry. Click the
+ in the upper right corner. In the next screen, enter the API endpoint of your site and write a cool name for that entry:
Next click the authentication tab below the url and fill in the email and password of the user with access to the API:
Click on the "Next" button.
Select how often you want to check for new data, enter an URL to a nice looking Icon (I used one of those) and hit "Save".
Congratulations! You can now see the number of pending comments in your menu bar 🥳
If you have further question, feel free to leave a comment below and I'll see it in my menu bar and may be able to help you. Also feel free to follow me on twitter so I can check if that entry is working as well 😉