mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-23 07:37:35 +00:00
4f75591060
Reformat code base to PSR12 Co-authored-by: rssbridge <noreply@github.com>
47 lines
1.5 KiB
PHP
47 lines
1.5 KiB
PHP
<?php
|
|
|
|
class WallpaperflareBridge extends XPathAbstract
|
|
{
|
|
const NAME = 'Wallpaperflare';
|
|
const URI = 'https://wallpaperflare.com';
|
|
const DESCRIPTION = 'Wallpaperflare is a provider for Wallpapers on nearly every topic, especially for Anime';
|
|
const MAINTAINER = 'dhuschde';
|
|
const PARAMETERS = [
|
|
'' => [
|
|
'search' => [
|
|
'name' => 'Search',
|
|
'exampleValue' => 'birds',
|
|
'required' => true
|
|
]
|
|
]];
|
|
const CACHE_TIMEOUT = 3600; //1 hour
|
|
const XPATH_EXPRESSION_ITEM = './/figure';
|
|
const XPATH_EXPRESSION_ITEM_TITLE = './/img/@title';
|
|
const XPATH_EXPRESSION_ITEM_CONTENT = '';
|
|
const XPATH_EXPRESSION_ITEM_URI = './/a[@itemprop="url"]/@href';
|
|
const XPATH_EXPRESSION_ITEM_AUTHOR = '/html[1]/body[1]/main[1]/section[1]/h1[1]';
|
|
const XPATH_EXPRESSION_ITEM_TIMESTAMP = '';
|
|
const XPATH_EXPRESSION_ITEM_ENCLOSURES = './/img/@data-src';
|
|
const XPATH_EXPRESSION_ITEM_CATEGORIES = './/figcaption[@itemprop="caption description"]';
|
|
const SETTING_FIX_ENCODING = false;
|
|
|
|
protected function getSourceUrl()
|
|
{
|
|
return 'https://www.wallpaperflare.com/search?wallpaper=' . $this->getInput('search');
|
|
}
|
|
|
|
public function getIcon()
|
|
{
|
|
return 'https://www.google.com/s2/favicons?domain=wallpaperflare.com/';
|
|
}
|
|
|
|
public function getName()
|
|
{
|
|
if (!is_null($this->getInput('search'))) {
|
|
return 'Wallpaperflare - ' . $this->getInput('search');
|
|
} else {
|
|
return 'Wallpaperflare';
|
|
}
|
|
}
|
|
}
|