2013-08-11 15:30:41 +04:00
|
|
|
<?php
|
|
|
|
/* rss-bridge library.
|
|
|
|
Foundation functions for rss-bridge project.
|
|
|
|
See https://github.com/sebsauvage/rss-bridge
|
|
|
|
Licence: Public domain.
|
|
|
|
*/
|
|
|
|
|
2018-11-06 20:08:53 +03:00
|
|
|
define('PATH_VENDOR', __DIR__ . '/../vendor');
|
2018-11-06 20:24:05 +03:00
|
|
|
define('PATH_LIB', __DIR__ . '/../lib');
|
|
|
|
|
|
|
|
require_once PATH_LIB . '/Exceptions.php';
|
|
|
|
require_once PATH_LIB . '/Format.php';
|
|
|
|
require_once PATH_LIB . '/FormatAbstract.php';
|
|
|
|
require_once PATH_LIB . '/Bridge.php';
|
|
|
|
require_once PATH_LIB . '/BridgeAbstract.php';
|
|
|
|
require_once PATH_LIB . '/FeedExpander.php';
|
|
|
|
require_once PATH_LIB . '/Cache.php';
|
|
|
|
require_once PATH_LIB . '/Authentication.php';
|
|
|
|
require_once PATH_LIB . '/Configuration.php';
|
|
|
|
require_once PATH_LIB . '/BridgeCard.php';
|
|
|
|
require_once PATH_LIB . '/BridgeList.php';
|
|
|
|
require_once PATH_LIB . '/ParameterValidator.php';
|
|
|
|
|
|
|
|
require_once PATH_LIB . '/html.php';
|
|
|
|
require_once PATH_LIB . '/error.php';
|
|
|
|
require_once PATH_LIB . '/contents.php';
|
2013-08-11 15:30:41 +04:00
|
|
|
|
2018-11-06 20:11:16 +03:00
|
|
|
require_once PATH_VENDOR . '/simplehtmldom/simple_html_dom.php';
|
|
|
|
require_once PATH_VENDOR . '/php-urljoin/src/urljoin.php';
|
2018-08-02 07:31:56 +03:00
|
|
|
|
2013-08-11 15:30:41 +04:00
|
|
|
/* Example use
|
2016-09-10 21:41:11 +03:00
|
|
|
|
|
|
|
require_once __DIR__ . '/lib/RssBridge.php';
|
|
|
|
|
|
|
|
// Data retrieval
|
|
|
|
Bridge::setDir(__DIR__ . '/bridges/');
|
|
|
|
$bridge = Bridge::create('GoogleSearch');
|
|
|
|
$bridge->collectData($_REQUEST);
|
|
|
|
|
|
|
|
// Data transformation
|
|
|
|
Format::setDir(__DIR__ . '/formats/');
|
|
|
|
$format = Format::create('Atom');
|
|
|
|
$format
|
|
|
|
->setItems($bridge->getItems())
|
|
|
|
->setExtraInfos(array(
|
|
|
|
'name' => $bridge->getName(),
|
|
|
|
'uri' => $bridge->getURI(),
|
2018-08-21 18:46:47 +03:00
|
|
|
'icon' => $bridge->getIcon(),
|
2016-09-10 21:41:11 +03:00
|
|
|
))
|
|
|
|
->display();
|
2013-08-11 15:30:41 +04:00
|
|
|
|
2015-11-05 13:12:58 +03:00
|
|
|
*/
|