mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-27 12:01:09 +03:00
7621784598
Adds favicon to bridges that support it. Some sites prevent downloading favicons, those bridges are left untouched. Affected bridges: - AutoJMBridge - BandcampBridge - BlaguesDeMerdeBridge - BloombergBridge - BundesbankBridge - ChristianDailyReporterBridge - ContainerLinuxReleasesBridge - DailymotionBridge - DiceBridge - DribbbleBridge - EliteDangerousGalnetBridge - ElsevierBridge - FacebookBridge - FB2Bridge - FDroidBridge - FierPandaBridge - GooglePlusPostBridge - JapanExpoBridge - KATBridge - KernelBugTrackerBridge - LegifranceJOBridge - NotAlwaysBridge - NyaaTorrentsBridge - PinterestBridge - RadioMelodieBridge - RainbowSixSiegeBridge - SupInfoBridge - TagBoardBridge - TebeoBridge - TheTVDBBridge - WhydBridge - ZoneTelechargementBridge
61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
class NotAlwaysBridge extends BridgeAbstract {
|
|
|
|
const MAINTAINER = 'mozes';
|
|
const NAME = 'Not Always family Bridge';
|
|
const URI = 'https://notalwaysright.com/';
|
|
const DESCRIPTION = 'Returns the latest stories';
|
|
const CACHE_TIMEOUT = 1800; // 30 minutes
|
|
|
|
const PARAMETERS = array( array(
|
|
'filter' => array(
|
|
'type' => 'list',
|
|
'name' => 'Filter',
|
|
'values' => array(
|
|
'All' => 'all',
|
|
'Right' => 'right',
|
|
'Working' => 'working',
|
|
'Romantic' => 'romantic',
|
|
'Related' => 'related',
|
|
'Learning' => 'learning',
|
|
'Friendly' => 'friendly',
|
|
'Hopeless' => 'hopeless',
|
|
'Unfiltered' => 'unfiltered'
|
|
),
|
|
'required' => true
|
|
)
|
|
));
|
|
|
|
public function getIcon() {
|
|
return self::URI . 'favicon_nar.png';
|
|
}
|
|
|
|
public function collectData(){
|
|
$html = getSimpleHTMLDOM($this->getURI())
|
|
or returnServerError('Could not request NotAlways.');
|
|
foreach($html->find('.post') as $post) {
|
|
#print_r($post);
|
|
$item = array();
|
|
$item['uri'] = $post->find('h1', 0)->find('a', 0)->href;
|
|
$item['content'] = $post;
|
|
$item['title'] = $post->find('h1', 0)->find('a', 0)->innertext;
|
|
$this->items[] = $item;
|
|
}
|
|
}
|
|
|
|
public function getName(){
|
|
if(!is_null($this->getInput('filter'))) {
|
|
return $this->getInput('filter') . ' - NotAlways Bridge';
|
|
}
|
|
|
|
return parent::getName();
|
|
}
|
|
|
|
public function getURI(){
|
|
if(!is_null($this->getInput('filter'))) {
|
|
return self::URI . $this->getInput('filter') . '/';
|
|
}
|
|
|
|
return parent::getURI();
|
|
}
|
|
}
|