[], 'Author' => [ 'uid' => [ 'name' => 'uid', 'required' => true, // Example: miriamrobern's stories 'exampleValue' => '149271', ], ], 'Series' => [ 'sid' => [ 'name' => 'sid', 'required' => true, // Example: latest chapters from Uskweirs 'exampleValue' => '965299', ], ], 'List' => [ 'url' => [ 'name' => 'url', 'required' => true, // Example: latest stories with the 'Transgender' tag 'exampleValue' => 'https://www.scribblehub.com/series-finder/?sf=1&gi=6&tgi=1088&sort=dateadded', ], ] ]; public function getIcon() { return self::URI . 'favicon.ico'; } public function collectData() { $url = 'https://rssscribblehub.com/rssfeed.php?type='; if ($this->queriedContext === 'List') { $this->collectList($this->getURI()); return; } if ($this->queriedContext === 'Author') { $url = $url . 'author&uid=' . $this->getInput('uid'); } else { //All and Series use the same source feed $url = $url . 'main'; } $this->collectExpandableDatas($url); } private function collectList($url) { $html = getSimpleHTMLDOMCached($url); foreach ($html->find('.search_main_box') as $element) { $item = []; $item['author'] = $element->find('[title="Author"]', 0)->plaintext; $item['enclosures'] = [$element->find('.search_img img', 0)->src]; $title = $element->find('.search_title a', 0); $item['title'] = $title->plaintext; $item['uri'] = $title->href; $item['uid'] = $item['uri']; $strdate = $element->find('[title="Last Updated"]', 0)->plaintext; $item['timestamp'] = strtotime($strdate); foreach ($element->find('.fic_genre') as $tag) { $item['categories'][] = $tag->plaintext; } // Get minimal description in case further requests fail $item['content'] = str_get_html($element->find('.search_body', 0)); foreach ($item['content']->firstChild()->children() as $child) { $child->remove(); } try { $details = getSimpleHTMLDOMCached($item['uri']); } catch (HttpException $e) { // 403 Forbidden, This means we got anti-bot response if ($e->getCode() === 403 || $e->getCode() === 429) { $this->items[] = $item; continue; } throw $e; } $item['enclosures'] = [$details->find('.fic_image img', 0)->src]; $item['content'] = $details->find('.wi_fic_desc', 0); foreach ($details->find('.stag') as $tag) { $item['categories'][] = $tag->plaintext; } $read_url = $details->find('.read_buttons a', 0)->href; $item['comments'] = $read_url . '#comments'; try { $read_html = getSimpleHTMLDOMCached($read_url); } catch (HttpException $e) { // 403 Forbidden, This means we got anti-bot response if ($e->getCode() === 403 || $e->getCode() === 429) { $this->items[] = $item; continue; } throw $e; } $item['content'] .= "