A script to generate a dashboard of (un)occupied computers in a library using LibData LibShield, without admin access.
Prerequisites:
- Python 3 (tested on 3.13.11)
- Your library's LibData server and password (I will not elaborate further)
git clone https://github.com/meskuk/libdata-status
cd libdata-status
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtThen copy config.example.json to config.json and edit it:
{
"library_name": "Local Library",
"libdata_server": "http://libdatacloud1.[region].cloudapp.azure.com:1996",
"libdata_password": "ReallySecurePass",
"groups": {
"First Floor": [
// Sorry, you will need to enter each computer's name!
// Use the login screen for reference
"PC-0001",
"PC-0002",
...
],
// Add as many groups as needed
"Second Floor": [
"PC-1337",
...
]
}
}Now you can invoke it!
python generate.py config.json path/to/output.html
Where path/to/output.html is likely a place on your web server.
Warning
Please check the output path, to avoid accidentally clobbering files.
Not being a daemon, you will have to use cron or systemd timers to run the script periodically.
By relying on an error message! For each computer, script sends a request to extend the current user's time:
POST http://server:1234/computer_cloud_api/extend_time/[computer]/[password]
If someone's logged in, the server returns OK (as in the request body, not just HTTP 200).
But if nobody's logged in, it returns FAILED and "No user to extend time".
If the computer is down or disconnected, the API returns FAILED with a different error.