[JornalDeNoticiasBridge]: Remove bridge (#3505)

This is now broken, it was replaced by a React monstrosity. The API
doesn't even let me read the post data, it demands authentication.
Bummer.

Better remove it now, since it's worthless.
This commit is contained in:
somini 2023-07-07 07:14:31 +01:00 committed by GitHub
parent 46f0e97c73
commit d49ea235f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,59 +0,0 @@
<?php
class JornalDeNoticiasBridge extends BridgeAbstract
{
const NAME = 'Jornal de Notícias (PT)';
const URI = 'https://jn.pt';
const DESCRIPTION = 'Jornal de Notícias (JN.PT)';
const MAINTAINER = 'somini';
const PARAMETERS = [
'URL' => [
'url' => [
'name' => 'URL (relative)',
'exampleValue' => 'opiniao/catia-domingues.html',
]
]
];
public function getIcon()
{
return 'https://static.globalnoticias.pt/jn/common/images/favicons/favicon-128.png';
}
public function getURI()
{
switch ($this->queriedContext) {
case 'URL':
$url = self::URI . '/' . $this->getInput('url');
break;
default:
$url = self::URI;
}
return $url;
}
public function collectData()
{
$archives = $this->getURI();
$html = getSimpleHTMLDOMCached($archives);
foreach ($html->find('article') as $element) {
$item = [];
$title = $element->find('h2 a', 0);
$link = $element->find('h2 a', 0);
$auth = $element->find('h3 a', 0);
$item['title'] = $title->plaintext;
$item['uri'] = self::URI . $link->href;
$item['author'] = $auth->plaintext;
$snippet = $element->find('h4 a', 0);
if ($snippet) {
$item['content'] = $snippet->plaintext;
}
$this->items[] = $item;
}
}
}