mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 08:28:46 +00:00
parent
d08b2616ef
commit
39a8346c53
@ -14,7 +14,10 @@ final class PokemonNewsBridge extends BridgeAbstract
|
|||||||
// todo: parse json api instead: https://www.pokemon.com/api/1/us/news/get-news.json
|
// todo: parse json api instead: https://www.pokemon.com/api/1/us/news/get-news.json
|
||||||
$url = 'https://www.pokemon.com/us/pokemon-news';
|
$url = 'https://www.pokemon.com/us/pokemon-news';
|
||||||
$dom = getSimpleHTMLDOM($url);
|
$dom = getSimpleHTMLDOM($url);
|
||||||
|
$haystack = (string)$dom;
|
||||||
|
if (str_contains($haystack, 'Request unsuccessful. Incapsula incident')) {
|
||||||
|
throw new \Exception('Blocked by anti-bot');
|
||||||
|
}
|
||||||
foreach ($dom->find('.news-list ul li') as $item) {
|
foreach ($dom->find('.news-list ul li') as $item) {
|
||||||
$title = $item->find('h3', 0)->plaintext;
|
$title = $item->find('h3', 0)->plaintext;
|
||||||
$description = $item->find('p.hidden-mobile', 0);
|
$description = $item->find('p.hidden-mobile', 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user