Download the PHP package baraveli/rss-scraper without Composer

On this page you can find all versions of the php package baraveli/rss-scraper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rss-scraper

Rss scraper

Build Status Latest Stable Version License

Rss Scraper logo Rss Scraper to scrap rss feed from news websites.

:rocket: Installation

Usage

To use this package when you install it be sure to create a config.json file inside your application and specify the sites you want to index.

:satellite: Rss Scraper Specs

This documentation decribe the rss scraper structure,usage and how the individual components work in the libary.

:crystal_ball: General Explanation

The rss scraper get the rss feed of the news from the configuration and get the rss feed items and return the data as a json response or an array.

Rss scraper configurations are stored in the configs directory as config.json file. The config file has the information about the rss feeds that the rss scraper calls to scrap the rss feed.

Example config:

This configuration file is loading the rss feed of vaguthu.

Thats pretty much it for the configuration file. Rss scraper has a util ConfigLoader class to load configuration data from the configs directory and return the rss feed url as an array.

The ConfigLoader class has one static load method which takes a filename as an argument to the method as a string. filename will be the name of the json file inside the configs directory. In this case the file name will be config. If a given file is not found load method throws an execption saying "Error reading the config file or it is empty."

Config loader class is shown below:

Client class inside the Http directory of the RSS scraper is used to send HTTP request to the RSS feed URL specified in the config to get the content. The class get method gets the content of the RSS URL and check if the returned data is a validxml content. isValidXmL() is helper method that is provided by the helper trait. if the isvalidxml check passes the xml file is then pass to the simplexml_load_string() function that is built into php. the returned loaded string get passed to parseXML method to return the decoded version of the xml file to php array. The data is then returned.

This classes uses guzzle to make the http request.

Client class is shown below:

Article collection is a class that is responsible for adding everything to a collection so that the collection can easily be manipluated as a array or json. Article collection class has an item array which holds all the items. Items are added through the add method given a value. Class also have a method called jsonify() which converts the responses to json and a toArray() method that converts the response to an array. Count method lets you to count the number of item inside the item array.

Article Collection class is shown below:


All versions of rss-scraper with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.0|^7.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package baraveli/rss-scraper contains the following files

Loading the files please wait ....