, (*1)
Installation
Add the prusmarcin/parserRssAtom package to your composer.json
file., (*2)
``` json
{
"require": {
"prusmarcin/parser-rss-atom": "0.*"
}
}, (*3)
Or via the command line in the root of your application installation.
``` bash
$ composer require "prusmarcin/parser-rss-atom:0.*"
Usage
``` php
use MarcinPrus\Parser\ParserClass as Parser;
use MarcinPrus\Save\SaveFileClass as Save;, (*4)
if (isset($argc) && isset($argv)) {
$parser = new Parser();
$parser->requestMethod = 'curl';
$parser->run();
$parser->parseCliParameters($argc, $argv);, (*5)
$save = new Save();
$save->fileType = $parser->fileType;
$response = $save->toFile(
$parser->path, $parser->saveOption, $parser->parseContent()
);
} else {}, (*6)
Commands
-------
Use onlny by CLI: Windows CMD, Unix Shell
``` bash
$ php src/console.php csv:simple http://feeds.nationalgeographic.com/ng/News/News_Main eksport_prosty.csv
OR, (*7)
``` bash
$ php src/console.php csv:extended http://feeds.nationalgeographic.com/ng/News/News_Main eksport_prosty.csv, (*8)
Result array
``` php
Array
(
[0] => Array
(
[info] => 1
[message] => Success - The file export_prosty.csv was saved in the root directory of the application.
)
)
A csv file is written to the disk. The columns are separated by a Tab
., (*9)
Testing
bash
$ phpunit
, (*10)
Contributing
Please see CONTRIBUTING for details., (*11)
Credits
License
The MIT License (MIT). Please see License File for more information., (*12)