blob: 827908f75e89f7c986636ff0b8396783d734d0dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
Installation
============
Versions
--------
- Development version: branch master
- Available versions:
- v0.1.0 (stable)
- v0.0.2
- v0.0.1
Installation with Composer
--------------------------
Configure your `composer.json`:
```json
{
"require": {
"fguillot/picofeed": "0.1.0"
}
}
```
Or simply:
```bash
composer require fguillot/picofeed:0.1.0
```
And download the code:
```bash
composer install # or update
```
Usage example with the Composer autoloading:
```php
<?php
require 'vendor/autoload.php';
use PicoFeed\Reader\Reader;
try {
$reader = new Reader;
$resource = $reader->download('https://linuxfr.org/news.atom');
$parser = $reader->getParser(
$resource->getUrl(),
$resource->getContent(),
$resource->getEncoding()
);
$feed = $parser->execute();
echo $feed;
}
catch (Exception $e) {
// Do something...
}
```
|