https://github.com/mhauri/lotto-parser
PHP library for parsing Swiss Lotto and Euro Millions results.
https://github.com/mhauri/lotto-parser
euromillions parser swisslos swisslotto
Last synced: 5 months ago
JSON representation
PHP library for parsing Swiss Lotto and Euro Millions results.
- Host: GitHub
- URL: https://github.com/mhauri/lotto-parser
- Owner: mhauri
- Created: 2021-02-23T09:38:17.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-23T13:12:13.000Z (over 5 years ago)
- Last Synced: 2025-08-23T02:53:55.796Z (10 months ago)
- Topics: euromillions, parser, swisslos, swisslotto
- Language: PHP
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.com/mhauri/lotto-parser)
[](https://www.codacy.com/gh/mhauri/lotto-parser/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mhauri/lotto-parser&utm_campaign=Badge_Grade)
[](https://www.codacy.com/gh/mhauri/lotto-parser/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mhauri/lotto-parser&utm_campaign=Badge_Coverage)
# Lotto Parser
PHP library for parsing [Swiss Lotto](https://www.swisslos.ch/en/swisslotto/information/winning-numbers/winning-numbers.html) and [Euro Millions](https://www.swisslos.ch/en/euromillions/information/winning-numbers/winning-numbers.html) results from [Swisslos](https://www.swisslos.ch/en/home.html).
## Installation
```
composer require mhauri/lotto-parser
```
## Usage
To get the latest results from Swiss Lotto
```php
current()->get();
// to Array
$data = $lotto->current()->toArray();
// to JSON
$data = $lotto->current()->toJson();
```
To get the results from a specific date
```php
byDate($date)->get();
// to Array
$data = $lotto->byDate($date)->toArray();
// to JSON
$data = $lotto->byDate($date)->toJson();
```
The same applies for Euro Millions, just replace `$lotto = new SwissLotto()` with
`$lotto = new EuroMillions();`
Support
-------
If you have any issues with this library, open an issue on [GitHub](https://github.com/mhauri/lotto-parser/issues).
Contribution
------------
Any contribution is highly appreciated. The best way to contribute code is to open
a [pull request on GitHub](https://help.github.com/articles/using-pull-requests).
Developer
---------
[Marcel Hauri](https://github.com/mhauri), and all
other [contributors](https://github.com/mhauri/lotto-parser/contributors)
License
-------
[MIT](https://opensource.org/licenses/MIT)