RSS API в PHP

Ara is a PHP class for generating an RSS feed in RSS 2.0 format.

Its use is very simple: several method calls to generate an RSS feed, add a channel, add articles, etc.

Use

Create an instance of the class:

$myfeed = new ara();

and associate properties and methods with this instance.

RSS Class Properties

They allow you to control the parameters of the RSS feed. The property is accessed by instance name.
Exempli gratia

$myfeed->DESC_SIZE = 500;
DESC_SIZE
Description size. This may be different because the class tries to break the description after the period .
FEED_MAX
Maximum number of items in the ribbon.
DESCENT
Add recent articles to the top of the list to see the latest articles first.

APA methods

They allow you to create an RSS file from raw data. The ribbon can be displayed using scripts such as RSS Reader or Common Reader.

ara ()
Constructor. Has no arguments.
ARAFeed (name, link, description, date)
Creates a channel and adds a channel according to the parameters passed as arguments.
build (url
)
Extracts channel data to the file specified as an argument, usually on the home page of the site, and calls the ARAFeed method.
ARAItem (name, link, description, date)
Adds an element built from arguments.
compression (size = -1
)
Reduces the number of elements to the number specified as the parameter. If not specified, uses FEED_MAX.
delete (item)
Deletes an element in the DOMNode format used by PHP.
load (file name)
Loads an RSS file and creates a tree structure in DOMDocument memory.
save (file name)
Saves the RSS feed to a file.
saveXML ()
Returns the channel as a string.
getData (url
)
Retrieves the title and description of the HTML page with the specified URL. Returns a simple array containing the title, description, and current date.
The method can find information in either metatags or the page body.

Download

All API functions are available in the ara-class.php file .

This file is included in the RSS ARA editor as well as the Bioloid online tool.