Reformat codebase v4 (#2872)

Reformat code base to PSR12

Co-authored-by: rssbridge <noreply@github.com>
This commit is contained in:
Dag 2022-07-01 15:10:30 +02:00 committed by GitHub
parent 66568e3a39
commit 4f75591060
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
398 changed files with 58607 additions and 56442 deletions

View file

@ -1,58 +1,63 @@
<?php
class FurAffinityUserBridge extends BridgeAbstract {
const NAME = 'FurAffinity User Gallery';
const URI = 'https://www.furaffinity.net';
const MAINTAINER = 'CyberJacob';
const DESCRIPTION = 'See https://rss-bridge.github.io/rss-bridge/Bridge_Specific/Furaffinityuser.html for explanation';
const PARAMETERS = array(
array(
'searchUsername' => array(
'name' => 'Search Username',
'type' => 'text',
'required' => true,
'title' => 'Username to fetch the gallery for',
'exampleValue' => 'armundy',
),
'aCookie' => array(
'name' => 'Login cookie \'a\'',
'type' => 'text',
'required' => true
),
'bCookie' => array(
'name' => 'Login cookie \'b\'',
'type' => 'text',
'required' => true
)
)
);
public function collectData() {
$opt = array(CURLOPT_COOKIE => 'b=' . $this->getInput('bCookie') . '; a=' . $this->getInput('aCookie'));
class FurAffinityUserBridge extends BridgeAbstract
{
const NAME = 'FurAffinity User Gallery';
const URI = 'https://www.furaffinity.net';
const MAINTAINER = 'CyberJacob';
const DESCRIPTION = 'See https://rss-bridge.github.io/rss-bridge/Bridge_Specific/Furaffinityuser.html for explanation';
const PARAMETERS = [
[
'searchUsername' => [
'name' => 'Search Username',
'type' => 'text',
'required' => true,
'title' => 'Username to fetch the gallery for',
'exampleValue' => 'armundy',
],
'aCookie' => [
'name' => 'Login cookie \'a\'',
'type' => 'text',
'required' => true
],
'bCookie' => [
'name' => 'Login cookie \'b\'',
'type' => 'text',
'required' => true
]
]
];
$url = self::URI . '/gallery/' . $this->getInput('searchUsername');
public function collectData()
{
$opt = [CURLOPT_COOKIE => 'b=' . $this->getInput('bCookie') . '; a=' . $this->getInput('aCookie')];
$html = getSimpleHTMLDOM($url, array(), $opt)
or returnServerError('Could not load the user\'s gallery page.');
$url = self::URI . '/gallery/' . $this->getInput('searchUsername');
$submissions = $html->find('section[id=gallery-gallery]', 0)->find('figure');
foreach($submissions as $submission) {
$item = array();
$item['title'] = $submission->find('figcaption', 0)->find('a', 0)->plaintext;
$html = getSimpleHTMLDOM($url, [], $opt)
or returnServerError('Could not load the user\'s gallery page.');
$thumbnail = $submission->find('a', 0);
$thumbnail->href = self::URI . $thumbnail->href;
$submissions = $html->find('section[id=gallery-gallery]', 0)->find('figure');
foreach ($submissions as $submission) {
$item = [];
$item['title'] = $submission->find('figcaption', 0)->find('a', 0)->plaintext;
$item['content'] = $submission->find('a', 0);
$thumbnail = $submission->find('a', 0);
$thumbnail->href = self::URI . $thumbnail->href;
$this->items[] = $item;
}
}
$item['content'] = $submission->find('a', 0);
public function getName() {
return self::NAME . ' for ' . $this->getInput('searchUsername');
}
$this->items[] = $item;
}
}
public function getURI() {
return self::URI . '/user/' . $this->getInput('searchUsername');
}
public function getName()
{
return self::NAME . ' for ' . $this->getInput('searchUsername');
}
public function getURI()
{
return self::URI . '/user/' . $this->getInput('searchUsername');
}
}