PHP code example of tuisme / laravel-feed-reader

1. Go to this page and download the library: Download tuisme/laravel-feed-reader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tuisme / laravel-feed-reader example snippets


'providers' => [

    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...
    Vedmant\FeedReader\FeedReaderServiceProvider::class, // Add this line

[,

'aliases' => [

    'App'        => Illuminate\Support\Facades\App::class,
    'Artisan'    => Illuminate\Support\Facades\Artisan::class,
    ...
    'FeedReader' => Vedmant\FeedReader\Facades\FeedReader::class, // Add this line
],

$f = FeedReader::read('https://news.google.com/news/rss');

echo $f->get_title();
echo $f->get_items()[0]->get_title();
echo $f->get_items()[0]->get_content();

// You need to log in to the rss endpoint with a Digest auth
$options = [
    'curl_options' => [
    CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
    CURLOPT_USERPWD => 'username:password'
]];

$f = FeedReader::read('https://news.google.com/news/rss', 'default', $options);

$ php artisan vendor:publish --provider="Vedmant\FeedReader\FeedReaderServiceProvider"