2019-09-16 22:25:28 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class DarkReadingBridge extends FeedExpander
|
2022-07-01 16:10:30 +03:00
|
|
|
{
|
2019-09-16 22:25:28 +03:00
|
|
|
const MAINTAINER = 'ORelio';
|
|
|
|
const NAME = 'Dark Reading Bridge';
|
|
|
|
const URI = 'https://www.darkreading.com/';
|
|
|
|
const DESCRIPTION = 'Returns the newest articles from Dark Reading';
|
|
|
|
|
|
|
|
const PARAMETERS = [ [
|
|
|
|
'feed' => [
|
2024-02-09 10:03:04 +03:00
|
|
|
'name' => 'Feed (NOT IN USE)',
|
2019-09-16 22:25:28 +03:00
|
|
|
'type' => 'list',
|
|
|
|
'values' => [
|
|
|
|
'All Dark Reading Stories' => '000_AllArticles',
|
|
|
|
'Attacks/Breaches' => '644_Attacks/Breaches',
|
|
|
|
'Application Security' => '645_Application%20Security',
|
|
|
|
'Database Security' => '646_Database%20Security',
|
|
|
|
'Cloud' => '647_Cloud',
|
|
|
|
'Endpoint' => '648_Endpoint',
|
|
|
|
'Authentication' => '649_Authentication',
|
|
|
|
'Privacy' => '650_Privacy',
|
|
|
|
'Mobile' => '651_Mobile',
|
|
|
|
'Perimeter' => '652_Perimeter',
|
|
|
|
'Risk' => '653_Risk',
|
|
|
|
'Compliance' => '654_Compliance',
|
|
|
|
'Operations' => '655_Operations',
|
|
|
|
'Careers and People' => '656_Careers%20and%20People',
|
|
|
|
'Identity and Access Management' => '657_Identity%20and%20Access%20Management',
|
|
|
|
'Analytics' => '658_Analytics',
|
2022-04-10 19:56:24 +03:00
|
|
|
'Threat Intelligence' => '659_Threat%20Intelligence',
|
2019-09-16 22:25:28 +03:00
|
|
|
'Security Monitoring' => '660_Security%20Monitoring',
|
2022-04-10 19:56:24 +03:00
|
|
|
'Vulnerabilities / Threats' => '661_Vulnerabilities%20/%20Threats',
|
2019-09-16 22:25:28 +03:00
|
|
|
'Advanced Threats' => '662_Advanced%20Threats',
|
|
|
|
'Insider Threats' => '663_Insider%20Threats',
|
|
|
|
'Vulnerability Management' => '664_Vulnerability%20Management',
|
2022-07-01 16:10:30 +03:00
|
|
|
]
|
|
|
|
],
|
2022-04-10 19:56:24 +03:00
|
|
|
'limit' => self::LIMIT,
|
|
|
|
]];
|
2019-09-16 22:25:28 +03:00
|
|
|
|
|
|
|
public function collectData()
|
2022-07-01 16:10:30 +03:00
|
|
|
{
|
2024-02-09 10:03:04 +03:00
|
|
|
$feed_url = 'https://www.darkreading.com/rss.xml';
|
2019-09-16 22:25:28 +03:00
|
|
|
$limit = $this->getInput('limit') ?? 10;
|
|
|
|
$this->collectExpandableDatas($feed_url, $limit);
|
|
|
|
}
|
|
|
|
|
2023-10-13 02:59:05 +03:00
|
|
|
protected function parseItem(array $item)
|
2019-09-16 22:25:28 +03:00
|
|
|
{
|
|
|
|
$article = getSimpleHTMLDOMCached($item['uri']);
|
|
|
|
$item['content'] = $this->extractArticleContent($article);
|
2021-10-29 23:21:07 +03:00
|
|
|
$item['enclosures'] = []; //remove author profile picture
|
|
|
|
$image = $article->find('meta[property="og:image"]', 0);
|
|
|
|
if (is_object($image)) {
|
|
|
|
$image = $image->content;
|
|
|
|
$item['enclosures'] = [$image];
|
2022-07-01 16:10:30 +03:00
|
|
|
}
|
2019-09-16 22:25:28 +03:00
|
|
|
return $item;
|
2022-07-01 16:10:30 +03:00
|
|
|
}
|
2019-09-16 22:25:28 +03:00
|
|
|
|
|
|
|
private function extractArticleContent($article)
|
2022-07-01 16:10:30 +03:00
|
|
|
{
|
2024-02-09 10:03:04 +03:00
|
|
|
$content = $article->find('div.ContentModule-Wrapper', 0)->innertext;
|
2019-09-16 22:25:28 +03:00
|
|
|
|
|
|
|
foreach (
|
2022-07-01 16:10:30 +03:00
|
|
|
[
|
2019-09-16 22:25:28 +03:00
|
|
|
'<div class="divsplitter',
|
|
|
|
'<div style="float: left; margin-right: 2px;',
|
|
|
|
'<div class="more-insights',
|
|
|
|
'<div id="more-insights',
|
|
|
|
] as $div_start
|
2022-07-01 16:10:30 +03:00
|
|
|
) {
|
2019-09-16 22:25:28 +03:00
|
|
|
$content = stripRecursiveHTMLSection($content, 'div', $div_start);
|
2022-07-01 16:10:30 +03:00
|
|
|
}
|
|
|
|
|
2022-11-22 20:42:31 +03:00
|
|
|
return convertLazyLoading($content);
|
2019-09-16 22:25:28 +03:00
|
|
|
}
|
|
|
|
}
|