mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-12 01:48:48 +00:00
[CdactionBridge] Add missing channels (#2477)
This commit is contained in:
parent
cbef3b3360
commit
2e88955648
@ -189,6 +189,7 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [hunhejj](https://github.com/hunhejj)
|
* [hunhejj](https://github.com/hunhejj)
|
||||||
* [husim0](https://github.com/husim0)
|
* [husim0](https://github.com/husim0)
|
||||||
* [IceWreck](https://github.com/IceWreck)
|
* [IceWreck](https://github.com/IceWreck)
|
||||||
|
* [imagoiq](https://github.com/imagoiq)
|
||||||
* [j0k3r](https://github.com/j0k3r)
|
* [j0k3r](https://github.com/j0k3r)
|
||||||
* [JackNUMBER](https://github.com/JackNUMBER)
|
* [JackNUMBER](https://github.com/JackNUMBER)
|
||||||
* [jacquesh](https://github.com/jacquesh)
|
* [jacquesh](https://github.com/jacquesh)
|
||||||
@ -223,7 +224,7 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [m0zes](https://github.com/m0zes)
|
* [m0zes](https://github.com/m0zes)
|
||||||
* [Mar-Koeh](https://github.com/Mar-Koeh)
|
* [Mar-Koeh](https://github.com/Mar-Koeh)
|
||||||
* [marcus-at-localhost](https://github.com/marcus-at-localhost)
|
* [marcus-at-localhost](https://github.com/marcus-at-localhost)
|
||||||
* [marius851000](https://github.com/marius851000)
|
* [marius8510000-bot](https://github.com/marius8510000-bot)
|
||||||
* [matthewseal](https://github.com/matthewseal)
|
* [matthewseal](https://github.com/matthewseal)
|
||||||
* [mcbyte-it](https://github.com/mcbyte-it)
|
* [mcbyte-it](https://github.com/mcbyte-it)
|
||||||
* [mdemoss](https://github.com/mdemoss)
|
* [mdemoss](https://github.com/mdemoss)
|
||||||
@ -238,6 +239,7 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [mro](https://github.com/mro)
|
* [mro](https://github.com/mro)
|
||||||
* [mschwld](https://github.com/mschwld)
|
* [mschwld](https://github.com/mschwld)
|
||||||
* [mxmehl](https://github.com/mxmehl)
|
* [mxmehl](https://github.com/mxmehl)
|
||||||
|
* [Mynacol](https://github.com/Mynacol)
|
||||||
* [nel50n](https://github.com/nel50n)
|
* [nel50n](https://github.com/nel50n)
|
||||||
* [niawag](https://github.com/niawag)
|
* [niawag](https://github.com/niawag)
|
||||||
* [Niehztog](https://github.com/Niehztog)
|
* [Niehztog](https://github.com/Niehztog)
|
||||||
@ -294,6 +296,8 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [thezeroalpha](https://github.com/thezeroalpha)
|
* [thezeroalpha](https://github.com/thezeroalpha)
|
||||||
* [timendum](https://github.com/timendum)
|
* [timendum](https://github.com/timendum)
|
||||||
* [TitiTestScalingo](https://github.com/TitiTestScalingo)
|
* [TitiTestScalingo](https://github.com/TitiTestScalingo)
|
||||||
|
* [tomaszkane](https://github.com/tomaszkane)
|
||||||
|
* [TReKiE](https://github.com/TReKiE)
|
||||||
* [triatic](https://github.com/triatic)
|
* [triatic](https://github.com/triatic)
|
||||||
* [VerifiedJoseph](https://github.com/VerifiedJoseph)
|
* [VerifiedJoseph](https://github.com/VerifiedJoseph)
|
||||||
* [WalterBarrett](https://github.com/WalterBarrett)
|
* [WalterBarrett](https://github.com/WalterBarrett)
|
||||||
|
@ -2,21 +2,50 @@
|
|||||||
|
|
||||||
class CdactionBridge extends BridgeAbstract {
|
class CdactionBridge extends BridgeAbstract {
|
||||||
const NAME = 'CD-ACTION bridge';
|
const NAME = 'CD-ACTION bridge';
|
||||||
const URI = 'https://cdaction.pl/newsy';
|
const URI = 'https://cdaction.pl';
|
||||||
const DESCRIPTION = 'Fetches the latest news.';
|
const DESCRIPTION = 'Fetches the latest posts from given category.';
|
||||||
const MAINTAINER = 'tomaszkane';
|
const MAINTAINER = 'tomaszkane';
|
||||||
|
const PARAMETERS = array( array(
|
||||||
|
'category' => array(
|
||||||
|
'name' => 'Kategoria',
|
||||||
|
'type' => 'list',
|
||||||
|
'values' => array(
|
||||||
|
'Najnowsze (wszystkie)' => 'najnowsze',
|
||||||
|
'Newsy' => 'newsy',
|
||||||
|
'Recenzje' => 'recenzje',
|
||||||
|
'Teksty' => array(
|
||||||
|
'Publicystyka' => 'publicystyka',
|
||||||
|
'Zapowiedzi' => 'zapowiedzi',
|
||||||
|
'Już graliśmy' => 'juz-gralismy',
|
||||||
|
'Poradniki' => 'poradniki',
|
||||||
|
),
|
||||||
|
'Kultura' => 'kultura',
|
||||||
|
'Wideo' => 'wideo',
|
||||||
|
'Czasopismo' => 'czasopismo',
|
||||||
|
'Technologie' => array(
|
||||||
|
'Artykuły' => 'artykuly',
|
||||||
|
'Testy' => 'testy',
|
||||||
|
),
|
||||||
|
'Na luzie' => array(
|
||||||
|
'Konkursy' => 'konkursy',
|
||||||
|
'Nadgodziny' => 'nadgodziny',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
))
|
||||||
|
);
|
||||||
|
|
||||||
public function collectData() {
|
public function collectData() {
|
||||||
$html = getSimpleHTMLDOM($this->getURI());
|
$html = getSimpleHTMLDOM($this->getURI() . '/' . $this->getInput('category'));
|
||||||
|
|
||||||
$newsJson = $html->find('script#__NEXT_DATA__', 0)->innertext;
|
$newsJson = $html->find('script#__NEXT_DATA__', 0)->innertext;
|
||||||
if (!$newsJson = json_decode($newsJson)) {
|
if (!$newsJson = json_decode($newsJson)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($newsJson->props->pageProps->dehydratedState->queries[1]->state->data->results as $news) {
|
$queriesIndex = $this->getInput('category') === 'najnowsze' ? 0 : 1;
|
||||||
|
foreach ($newsJson->props->pageProps->dehydratedState->queries[$queriesIndex]->state->data->results as $news) {
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['uri'] = $this->getURI() . '/' . $news->slug;
|
$item['uri'] = $this->getURI() . '/' . $news->category->slug . '/' . $news->slug;
|
||||||
$item['title'] = $news->title;
|
$item['title'] = $news->title;
|
||||||
$item['timestamp'] = $news->publishedAt;
|
$item['timestamp'] = $news->publishedAt;
|
||||||
$item['author'] = $news->editor->fullName;
|
$item['author'] = $news->editor->fullName;
|
||||||
|
Loading…
Reference in New Issue
Block a user