| 1 | #! perl | ||
| 2 | |||
| 3 | use v5.36; | ||
| 4 | use utf8; | ||
| 5 | |||
| 6 | use Weenect::API; | ||
| 7 | |||
| 8 | package Weenect; | ||
| 9 | |||
| 10 | our $VERSION = "1.02"; | ||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | Weenect - API to Weenect tracker server | ||
| 15 | |||
| 16 | =head1 SYNOPSIS | ||
| 17 | |||
| 18 | use Weenect::API; | ||
| 19 | my $api = Weenect::API->new; | ||
| 20 | |||
| 21 | # Connect to the Weenect server. | ||
| 22 | $api->login( "me@example.com", "mypassword" ); | ||
| 23 | |||
| 24 | # Get a list of trackers. | ||
| 25 | my $trackers = $api->get_trackers; | ||
| 26 | |||
| 27 | # Process tracker data. | ||
| 28 | foreach my $tracker ( $trackers->items->@* ) { | ||
| 29 | printf("Tracker %s [%d%s]\n", $tracker->name, $tracker->id, | ||
| 30 | $tracker->active ? "" : ",inactive" ); | ||
| 31 | } | ||
| 32 | |||
| 33 | $api->logout; # generally not needed | ||
| 34 | |||
| 35 | =head1 DESCRIPTION | ||
| 36 | |||
| 37 | This package facilitates connecting to the Weenect server and fetching | ||
| 38 | user and tracker data. | ||
| 39 | |||
| 40 | See the programs in the scripts directory for examples. | ||
| 41 | |||
| 42 | =head1 LICENSE | ||
| 43 | |||
| 44 | Copyright (C) 2026, Johan Vromans | ||
| 45 | |||
| 46 | This module is free software. You can redistribute it and/or | ||
| 47 | modify it under the terms of the Artistic License 2.0. | ||
| 48 | |||
| 49 | This program is distributed in the hope that it will be useful, | ||
| 50 | but without any warranty; without even the implied warranty of | ||
| 51 | merchantability or fitness for a particular purpose. | ||
| 52 | |||
| 53 | =cut | ||
| 54 | |||
| 55 | 1; |