diff --git a/bridges/CdactionBridge.php b/bridges/CdactionBridge.php new file mode 100644 index 00000000000..5b751a5bb69 --- /dev/null +++ b/bridges/CdactionBridge.php @@ -0,0 +1,31 @@ +getURI()); + + $newsJson = $html->find('script#__NEXT_DATA__', 0)->innertext; + if (!$newsJson = json_decode($newsJson)) { + return; + } + + foreach ($newsJson->props->pageProps->dehydratedState->queries[1]->state->data->results as $news) { + $item = array(); + $item['uri'] = $this->getURI() . '/' . $news->slug; + $item['title'] = $news->title; + $item['timestamp'] = $news->publishedAt; + $item['author'] = $news->editor->fullName; + $item['content'] = $news->lead; + $item['enclosures'][] = $news->bannerUrl; + $item['categories'] = array_column($news->tags, 'name'); + $item['uid'] = $news->id; + + $this->items[] = $item; + } + } +}