A very simple light-weight RSS parser
- PHP 99.4%
- Makefile 0.6%
| .idea | ||
| src/RssLib | ||
| tests | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| CHANGELOG.md | ||
| LICENSE | ||
| Makefile | ||
| project.json | ||
| README.md | ||
RssLib
RssLib is a library used to parse RSS feeds and return the data in a usable format.
Table of contents
Installation
The library can be installed using ncc:
ncc install -p "nosial/libs.rss=latest@n64"
or by adding the following to your project.json file under the build.dependencies section:
{
"name": "net.nosial.rsslib",
"version": "latest",
"source_type": "remote",
"source": "nosial/libs.rsslib=latest@n64"
}
If you don't have the n64 source configured, you can add it by running the following command:
ncc source add --name n64 --type gitlab --host git.n64.cc
Compile from source
To compile the library from source, you need to have ncc installed, then run the following command:
ncc build
Requirements
The library requires PHP 8.0 or higher.
Documentation
The library is designed to be used as a dependency in other projects, and as such, does not have a command-line interface. The library is designed to be used as follows:
try
{
$feed = \RssLib\RssLib::getFeed('https://rss.nytimes.com/services/xml/rss/nyt/World.xml');
}
catch(\RssLib\Exceptions\RssFeedException $e)
{
echo $e->getMessage();
exit(1);
}
print("Title: {$feed->getTitle()}\n");
print("Description: {$feed->getDescription()}\n");
foreach($feed->getItems() as $item)
{
print("Item: {$item->getTitle()}\n");
print("Description: {$item->getDescription()}\n");
print("Link: {$item->getLink()}\n");
}
License
Distributed under the MIT License. See LICENSE for more information.