Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mehedimi/feed-reader
A simple rss and atom feed reader
https://github.com/mehedimi/feed-reader
atom atom-feed feed laravel-rss-feed rss rss-feed rss-feed-scraper
Last synced: about 1 month ago
JSON representation
A simple rss and atom feed reader
- Host: GitHub
- URL: https://github.com/mehedimi/feed-reader
- Owner: mehedimi
- License: mit
- Created: 2020-05-31T06:05:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T13:28:07.000Z (over 4 years ago)
- Last Synced: 2024-04-19T03:03:56.102Z (7 months ago)
- Topics: atom, atom-feed, feed, laravel-rss-feed, rss, rss-feed, rss-feed-scraper
- Language: PHP
- Homepage: https://github.com/mehedimi/feed-reader
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Feed Reader
A simple feed reader
## Installation
```bash
$ composer require mehedimi/feed-reader
```
## Basic Uses:```php
rss('http://your-url.com/rss')
->read();
echo $rss->getTitle(); // Get the channel title// Access channel extra field
echo $rss->channel()->extra;
foreach ($rss->items() as $item) {
echo $item->title; // Get the item title
// Accessing attribute
echo $item->title->attributes()->attributeName;
}// Reading Atom Feed
$atom = $feed->atom('http://your-url.com/atom')
->read();
echo $atom->getTitle(); // Title
echo $atom->getUpdated()->format('d F, Y'); // Last Updated Date// Access channel extra field
echo $atom->feed()->extra;foreach ($atom->entries() as $entry) {
echo $entry->title; // Get the item title
// Accessing attribute
echo $entry->title->attributes()->attributeName;
}
```## Authentication
If your feed resource are protected by HTTP Basic Auth then you can use `basicAuth`
```php
rss('url')
->basicAuth('username', 'password')
->read();
// OR
$feed->atom('url')
->basicAuth('username', 'password')
->read();
```## With Laravel
```php
read();
```