Rss-Bridge/CREATE_BRIDGE.md
teromene 1c869631d6 Ajout d'options multiples pour les méta-données.
Ajout d'un bridge de démonstration, DemoBridge.
Ajout d'un début de documentation pour créer un bridge dans CREATE_BRIDGE.md
2015-11-03 14:36:19 +00:00

23 lines
948 B
Markdown

# Howto create a bridge
A bridge is an interface that allows rss-bridge to create a RSS feed from a website.
The bridge is a PHP file, located in the `bridges/` folder.
##Specifications
A rss bridge must extend the `BridgeAbstract` class, and implement the following functions :
* The `loadMetadatas` function, described below,
* The `getCacheDuration` function, describing the time during which rss-bridge will output cached values instead of re-generating a RSS feed.
* The `collectData` function, also described below.
##The `collectData` function
This function takes as a parameter an array called `$param`, that is automatically filled with values from the user, according to the values setted in `loadMetadatas`.
This function is the place where all the website scrapping and the RSS feed generation process will go.
The RSS elements are stored in the class variable `items[]`.
Every RSS element is an instance of the `Item` class.