diff --git a/BridgeAbstract.md b/BridgeAbstract.md new file mode 100644 index 0000000..5db2d7e --- /dev/null +++ b/BridgeAbstract.md @@ -0,0 +1,221 @@ +`BridgeAbstract` is a base class intended for standard Bridges that need to filter HTML pages for content. + +To create a new Bridge extending `BridgeAbstract` you must implement following functions: + +- [`loadMetadatas`](#the-loadmetadatas-function) (**required**) +- [`collectData`](#the-collectdata-function) (**required**) +- [`getName`](#the-getname-function) +- [`getURI`](#the-geturi-function) +- [`getCacheDuration`](#the-getcacheduration-function) + +Find a [template](#template) at the end of this file. + +## The `loadMetadatas` function + +This function is used by **RSS-Bridge** to determine the name, maintainer name, website, last updated date... of the bridge, and the user parameters. + +### Basic metadata + +The basic metadata are : + +```PHP +$this->maintainer // Name of the maintainer +$this->name // Name of the bridge +$this->uri // URI to the target website of the bridge ("http://....") +$this->description // A brief description of the bridge +$this->update // Date of last change in format "yyyy-mm-dd" +$this->parameters // (optional) Definition of additional parameters +``` + +Find a description of `$this->parameters` [below](#parameters) + +The default values are : + +```PHP +$this->maintainer = 'No maintainer'; +$this->name = "Unnamed bridge"; +$this->uri = ""; +$this->description = 'No description provided'; +$this->parameters = array(); +``` + +### Parameters + +Parameters are defined in a JSON-like format, which is parsed and transformed into a HTML `