https://github.com/phalski/skipass-client
A PHP client to access skipass site contents
https://github.com/phalski/skipass-client
php
Last synced: 2 months ago
JSON representation
A PHP client to access skipass site contents
- Host: GitHub
- URL: https://github.com/phalski/skipass-client
- Owner: phalski
- License: mit
- Created: 2018-08-07T07:03:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T11:53:08.000Z (over 6 years ago)
- Last Synced: 2025-01-21T15:14:11.670Z (4 months ago)
- Topics: php
- Language: HTML
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Skipass site scraping client
Usage:
```php
count();
} catch (\Phalski\Skipass\FetchException $e) {
// something went wrong with the http request
}// retrieve the usage data of a specific day (day_id is between 0 and count())
try {
$result = $skipass->findById(2);
if ($result->hasErrors()) {
// handle all the errors withing $result->getErrors()
throw new LogicException();
}
$data = $result->getData();
} catch (\Phalski\Skipass\FetchException $e) {
// something went wrong with the http request for the latest count
} catch (\InvalidArgumentException $e) {
// day_id is not between 0 and count()
}// retrieve the usage data of multiple days
$first = 3;
$offset = 5;
try {
$result = $skipass->findAll($first, $offset);
if ($result->hasErrors()) {
// handle all the errors withing $result->getErrors()
throw new LogicException();
}
$data = $result->getData();
} catch (\Phalski\Skipass\FetchException $e) {
// something went wrong with the http request for the latest count
} catch (\InvalidArgumentException $e) {
// offset is not between 0 and count()
}// retrieve the usage data of all days
try {
$result = $skipass->findAll(-1);
if ($result->hasErrors()) {
// handle all the errors withing $result->getErrors()
throw new LogicException();
}
$data = $result->getData();
} catch (\Phalski\Skipass\FetchException $e) {
// something went wrong with the http request for the latest count
} catch (\InvalidArgumentException $e) {
// day_id is not between 0 and count()
}```