1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-26 09:34:46 +02:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Dag
961a576d15 Update 06_Public_Hosts.md
Modify url to use https.
2022-06-10 17:18:21 +02:00
7 changed files with 192 additions and 113 deletions

View File

@@ -125,20 +125,18 @@ Use this script to generate the list automatically (using the GitHub API):
* [aledeg](https://github.com/aledeg)
* [alex73](https://github.com/alex73)
* [alexAubin](https://github.com/alexAubin)
* [Alkarex](https://github.com/Alkarex)
* [AmauryCarrade](https://github.com/AmauryCarrade)
* [AntoineTurmel](https://github.com/AntoineTurmel)
* [arnd-s](https://github.com/arnd-s)
* [ArthurHoaro](https://github.com/ArthurHoaro)
* [Astalaseven](https://github.com/Astalaseven)
* [Astyan-42](https://github.com/Astyan-42)
* [austinhuang0131](https://github.com/austinhuang0131)
* [AxorPL](https://github.com/AxorPL)
* [ayacoo](https://github.com/ayacoo)
* [az5he6ch](https://github.com/az5he6ch)
* [b1nj](https://github.com/b1nj)
* [benasse](https://github.com/benasse)
* [Binnette](https://github.com/Binnette)
* [BoboTiG](https://github.com/BoboTiG)
* [Bockiii](https://github.com/Bockiii)
* [captn3m0](https://github.com/captn3m0)
* [chemel](https://github.com/chemel)
@@ -164,9 +162,7 @@ Use this script to generate the list automatically (using the GitHub API):
* [Dreckiger-Dan](https://github.com/Dreckiger-Dan)
* [drego85](https://github.com/drego85)
* [drklee3](https://github.com/drklee3)
* [DRogueRonin](https://github.com/DRogueRonin)
* [dvikan](https://github.com/dvikan)
* [eggwhalefrog](https://github.com/eggwhalefrog)
* [em92](https://github.com/em92)
* [eMerzh](https://github.com/eMerzh)
* [EtienneM](https://github.com/EtienneM)
@@ -180,7 +176,6 @@ Use this script to generate the list automatically (using the GitHub API):
* [Frenzie](https://github.com/Frenzie)
* [fulmeek](https://github.com/fulmeek)
* [ggiessen](https://github.com/ggiessen)
* [gileri](https://github.com/gileri)
* [Ginko-Aloe](https://github.com/Ginko-Aloe)
* [girlpunk](https://github.com/girlpunk)
* [Glandos](https://github.com/Glandos)
@@ -199,7 +194,6 @@ Use this script to generate the list automatically (using the GitHub API):
* [j0k3r](https://github.com/j0k3r)
* [JackNUMBER](https://github.com/JackNUMBER)
* [jacquesh](https://github.com/jacquesh)
* [jakubvalenta](https://github.com/jakubvalenta)
* [JasonGhent](https://github.com/JasonGhent)
* [jcgoette](https://github.com/jcgoette)
* [jdesgats](https://github.com/jdesgats)
@@ -211,21 +205,15 @@ Use this script to generate the list automatically (using the GitHub API):
* [johnnygroovy](https://github.com/johnnygroovy)
* [johnpc](https://github.com/johnpc)
* [joni1993](https://github.com/joni1993)
* [jtojnar](https://github.com/jtojnar)
* [KamaleiZestri](https://github.com/KamaleiZestri)
* [kkoyung](https://github.com/kkoyung)
* [klimplant](https://github.com/klimplant)
* [KN4CK3R](https://github.com/KN4CK3R)
* [kolarcz](https://github.com/kolarcz)
* [kranack](https://github.com/kranack)
* [kraoc](https://github.com/kraoc)
* [krisu5](https://github.com/krisu5)
* [l1n](https://github.com/l1n)
* [laBecasse](https://github.com/laBecasse)
* [lagaisse](https://github.com/lagaisse)
* [lalannev](https://github.com/lalannev)
* [langfingaz](https://github.com/langfingaz)
* [lassana](https://github.com/lassana)
* [ldidry](https://github.com/ldidry)
* [Leomaradan](https://github.com/Leomaradan)
* [leyrer](https://github.com/leyrer)
@@ -244,7 +232,6 @@ Use this script to generate the list automatically (using the GitHub API):
* [melangue](https://github.com/melangue)
* [metaMMA](https://github.com/metaMMA)
* [mibe](https://github.com/mibe)
* [mickaelBert](https://github.com/mickaelBert)
* [mightymt](https://github.com/mightymt)
* [mitsukarenai](https://github.com/mitsukarenai)
* [Monocularity](https://github.com/Monocularity)
@@ -252,14 +239,11 @@ Use this script to generate the list automatically (using the GitHub API):
* [mr-flibble](https://github.com/mr-flibble)
* [mro](https://github.com/mro)
* [mschwld](https://github.com/mschwld)
* [muekoeff](https://github.com/muekoeff)
* [mw80](https://github.com/mw80)
* [mxmehl](https://github.com/mxmehl)
* [Mynacol](https://github.com/Mynacol)
* [nel50n](https://github.com/nel50n)
* [niawag](https://github.com/niawag)
* [Niehztog](https://github.com/Niehztog)
* [NikNikYkt](https://github.com/NikNikYkt)
* [Nono-m0le](https://github.com/Nono-m0le)
* [obsiwitch](https://github.com/obsiwitch)
* [Ololbu](https://github.com/Ololbu)
@@ -267,23 +251,18 @@ Use this script to generate the list automatically (using the GitHub API):
* [otakuf](https://github.com/otakuf)
* [Park0](https://github.com/Park0)
* [Paroleen](https://github.com/Paroleen)
* [Patricol](https://github.com/Patricol)
* [paulchen](https://github.com/paulchen)
* [PaulVayssiere](https://github.com/PaulVayssiere)
* [pellaeon](https://github.com/pellaeon)
* [PeterDaveHello](https://github.com/PeterDaveHello)
* [Peterr-K](https://github.com/Peterr-K)
* [Piranhaplant](https://github.com/Piranhaplant)
* [pirnz](https://github.com/pirnz)
* [pit-fgfjiudghdf](https://github.com/pit-fgfjiudghdf)
* [pitchoule](https://github.com/pitchoule)
* [pmaziere](https://github.com/pmaziere)
* [Pofilo](https://github.com/Pofilo)
* [prysme01](https://github.com/prysme01)
* [pubak42](https://github.com/pubak42)
* [Qluxzz](https://github.com/Qluxzz)
* [quentinus95](https://github.com/quentinus95)
* [quickwick](https://github.com/quickwick)
* [rakoo](https://github.com/rakoo)
* [RawkBob](https://github.com/RawkBob)
* [regisenguehard](https://github.com/regisenguehard)
@@ -292,7 +271,6 @@ Use this script to generate the list automatically (using the GitHub API):
* [Roliga](https://github.com/Roliga)
* [ronansalmon](https://github.com/ronansalmon)
* [rremizov](https://github.com/rremizov)
* [s0lesurviv0r](https://github.com/s0lesurviv0r)
* [sal0max](https://github.com/sal0max)
* [sebsauvage](https://github.com/sebsauvage)
* [shutosg](https://github.com/shutosg)
@@ -300,9 +278,7 @@ Use this script to generate the list automatically (using the GitHub API):
* [Simounet](https://github.com/Simounet)
* [somini](https://github.com/somini)
* [SpangleLabs](https://github.com/SpangleLabs)
* [SqrtMinusOne](https://github.com/SqrtMinusOne)
* [squeek502](https://github.com/squeek502)
* [StelFux](https://github.com/StelFux)
* [stjohnjohnson](https://github.com/stjohnjohnson)
* [Stopka](https://github.com/Stopka)
* [Strubbl](https://github.com/Strubbl)
@@ -315,21 +291,16 @@ Use this script to generate the list automatically (using the GitHub API):
* [teromene](https://github.com/teromene)
* [tgkenney](https://github.com/tgkenney)
* [thefranke](https://github.com/thefranke)
* [ThePadawan](https://github.com/ThePadawan)
* [TheRadialActive](https://github.com/TheRadialActive)
* [theScrabi](https://github.com/theScrabi)
* [thezeroalpha](https://github.com/thezeroalpha)
* [thibaultcouraud](https://github.com/thibaultcouraud)
* [timendum](https://github.com/timendum)
* [TitiTestScalingo](https://github.com/TitiTestScalingo)
* [tomaszkane](https://github.com/tomaszkane)
* [tomershvueli](https://github.com/tomershvueli)
* [TotalCaesar659](https://github.com/TotalCaesar659)
* [tpikonen](https://github.com/tpikonen)
* [TReKiE](https://github.com/TReKiE)
* [triatic](https://github.com/triatic)
* [User123698745](https://github.com/User123698745)
* [VerifiedJoseph](https://github.com/VerifiedJoseph)
* [vitkabele](https://github.com/vitkabele)
* [WalterBarrett](https://github.com/WalterBarrett)
* [wtuuju](https://github.com/wtuuju)
* [xurxof](https://github.com/xurxof)

View File

@@ -15,15 +15,27 @@ class KununuBridge extends BridgeAbstract {
'values' => array(
'Austria' => 'at',
'Germany' => 'de',
'Switzerland' => 'ch'
'Switzerland' => 'ch',
'United States' => 'us'
),
'exampleValue' => 'de',
),
'full' => array(
'name' => 'Load full article',
'type' => 'checkbox',
'exampleValue' => 'checked',
'title' => 'Activate to load full article'
),
'include_ratings' => array(
'name' => 'Include ratings',
'type' => 'checkbox',
'title' => 'Activate to include ratings in the feed'
),
'include_benefits' => array(
'name' => 'Include benefits',
'type' => 'checkbox',
'title' => 'Activate to include benefits in the feed'
),
'limit' => array(
'name' => 'Limit',
'type' => 'number',
@@ -35,27 +47,40 @@ class KununuBridge extends BridgeAbstract {
'company' => array(
'name' => 'Company',
'required' => true,
'exampleValue' => 'kununu',
'title' => 'Insert company name (i.e. Kununu) or URI path (i.e. kununu)'
'exampleValue' => 'adesso',
'title' => 'Insert company name (i.e. Kununu US) or URI path (i.e. kununu-us)'
)
)
);
private $companyName = '';
public function getURI() {
public function getURI(){
if(!is_null($this->getInput('company')) && !is_null($this->getInput('site'))) {
$company = $this->fixCompanyName($this->getInput('company'));
$site = $this->getInput('site');
$section = '';
return sprintf('%s%s/%s', self::URI, $site, $company);
switch($site) {
case 'at':
case 'de':
case 'ch':
$section = 'kommentare';
break;
case 'us':
$section = 'reviews';
break;
}
$url = sprintf('%s%s/%s/%s?sort=update_time_desc', self::URI, $site, $company, $section);
return $url;
}
return parent::getURI();
}
public function getName() {
public function getName(){
if(!is_null($this->getInput('company'))) {
$company = $this->fixCompanyName($this->getInput('company'));
return ($this->companyName ?: $company) . ' - ' . self::NAME;
@@ -68,24 +93,64 @@ class KununuBridge extends BridgeAbstract {
return 'https://www.kununu.com/favicon-196x196.png';
}
/**
* All css selectors need rework
*/
public function collectData(){
$full = $this->getInput('full');
// Load page
$json = json_decode(getContents($this->getAPI()), true);
$this->companyName = $json['common']['name'];
$baseURI = $this->getURI() . '/bewertung/';
$html = getSimpleHTMLDOM($this->getURI());
$html = defaultLinkTo($html, static::URI);
// Update name for this request
$company = $html->find('span[class="company-name"]', 0)
or returnServerError('Cannot find company name!');
$this->companyName = $company->innertext;
// Find the section with all the panels (reviews)
$section = $html->find('section.kununu-scroll-element', 0)
or returnServerError('Unable to find panel section!');
// Find all articles (within the panels)
$articles = $section->find('article')
or returnServerError('Unable to find articles!');
$limit = $this->getInput('limit') ?: 0;
// Go through all articles
foreach($json['reviews'] as $review) {
foreach($articles as $article) {
$anchor = $article->find('h1.review-title a', 0)
or returnServerError('Cannot find article URI!');
$date = $article->find('meta[itemprop=dateCreated]', 0)
or returnServerError('Cannot find article date!');
$rating = $article->find('span.rating', 0)
or returnServerError('Cannot find article rating!');
$summary = $article->find('[itemprop=name]', 0)
or returnServerError('Cannot find article summary!');
$item = array();
$item['author'] = $review['position'] . ' / ' . $review['department'];
$item['timestamp'] = $review['createdAt'];
$item['title'] = $review['roundedScore'] . ' : ' . $review['title'];
$item['uri'] = $baseURI . $review['uuid'];
$item['content'] = $this->extractArticleDescription($review);
$item['author'] = $this->extractArticleAuthorPosition($article);
$item['timestamp'] = strtotime($date->content);
$item['title'] = $rating->getAttribute('aria-label')
. ' : '
. strip_tags($summary->innertext);
$item['uri'] = $anchor->href;
if($full) {
$item['content'] = $this->extractFullDescription($item['uri']);
} else {
$item['content'] = $this->extractArticleDescription($article);
}
$this->items[] = $item;
if ($limit > 0 && count($this->items) >= $limit) break;
@@ -93,18 +158,6 @@ class KununuBridge extends BridgeAbstract {
}
}
/**
* Returns JSON API url
*/
private function getAPI() {
$company = $this->fixCompanyName($this->getInput('company'));
$site = $this->getInput('site');
return self::URI . 'middlewares/profiles/' .
$site . '/' . $company .
'/reviews?reviewType=employees&urlParams=sort=newest&sort=newest&page=1';
}
/*
* Returns a fixed version of the provided company name
*/
@@ -120,28 +173,75 @@ class KununuBridge extends BridgeAbstract {
}
/**
* Returns the description from a given article
* Returns the position of the author from a given article
*/
private function extractArticleDescription($json){
$retVal = '';
foreach($json['texts'] as $text) {
$retVal .= '<h4>' . $text['id'] . '</h4><p>' . $text['text'] . '</p>';
private function extractArticleAuthorPosition($article){
// We need to parse the user-content manually
$user_content = $article->find('div.user-content', 0)
or returnServerError('Cannot find user content!');
// Go through all h2 elements to find index of required span (I know... it's stupid)
$author_position = 'Unknown';
foreach($user_content->find('div') as $content) {
if(stristr(strtolower($content->plaintext), 'position')) { /* This works for at, ch, de, us */
$author_position = $content->next_sibling()->plaintext;
break;
}
}
if($this->getInput('include_ratings') && !empty($json['ratings'])) {
return $author_position;
}
/**
* Returns the description from a given article
*/
private function extractArticleDescription($article){
$description = $article->find('[itemprop=reviewBody]', 0)
or returnServerError('Cannot find article description!');
$retVal = $description->innertext;
if($this->getInput('include_ratings')
&& ($ratings = $article->find('.review-ratings .rating-group'))) {
$retVal .= (empty($retVal) ? '' : '<hr>') . '<table>';
foreach($json['ratings'] as $rating) {
foreach($ratings as $rating) {
$retVal .= <<<EOD
<tr>
<td>{$rating['id']}
<td>{$rating['roundedScore']}
<td>{$rating['text']}
<td>{$rating->find('.rating-title', 0)->plaintext}
<td>{$rating->find('.rating-badge', 0)->plaintext}
</tr>
EOD;
}
$retVal .= '</table>';
}
if($this->getInput('include_benefits')
&& ($benefits = $article->find('benefit'))) {
$retVal .= (empty($retVal) ? '' : '<hr>') . '<ul>';
foreach($benefits as $benefit) {
$retVal .= "<li>{$benefit->plaintext}</li>";
}
$retVal .= '</ul>';
}
return $retVal;
}
/**
* Returns the full description from a given uri
*/
private function extractFullDescription($uri){
// Load full article
$html = getSimpleHTMLDOMCached($uri)
or returnServerError('Could not load full description!');
$html = defaultLinkTo($html, static::URI);
// Find the article
$article = $html->find('article', 0)
or returnServerError('Cannot find article!');
// Luckily they use the same layout for the review overview and full article pages :)
return $this->extractArticleDescription($article);
}
}

View File

@@ -1,40 +1,36 @@
<?php
class MsnMondeBridge extends FeedExpander {
class MsnMondeBridge extends BridgeAbstract {
const MAINTAINER = 'kranack';
const NAME = 'MSN Actu Monde';
const URI = 'http://www.msn.com/';
const DESCRIPTION = 'Returns the 10 newest posts from MSN Actualités (full text)';
const URI = 'https://www.msn.com/fr-fr/actualite';
const FEED_URL = 'https://rss.msn.com/fr-fr';
const JSON_URL = 'https://assets.msn.com/content/view/v2/Detail/fr-fr/';
const LIMIT = 10;
public function getName() {
return 'MSN Actualités';
public function getURI(){
return self::URI . 'fr-fr/actualite/monde';
}
public function getURI() {
return self::URI;
private function msnMondeExtractContent($url, &$item){
$html2 = getSimpleHTMLDOM($url);
$item['content'] = $html2->find('#content', 0)->find('article', 0)->find('section', 0)->plaintext;
$item['timestamp'] = strtotime($html2->find('.authorinfo-txt', 0)->find('time', 0)->datetime);
}
public function collectData() {
$this->collectExpandableDatas(self::FEED_URL, self::LIMIT);
}
public function collectData(){
$html = getSimpleHTMLDOM($this->getURI());
protected function parseItem($newsItem) {
$item = parent::parseItem($newsItem);
if (!preg_match('#fr-fr/actualite.*/ar-(?<id>[\w]*)\?#', $item['uri'], $matches)) {
return;
$limit = 0;
// TODO: fix why articles is empty
foreach($html->find('.smalla') as $article) {
if($limit < 10) {
$item = array();
$item['title'] = utf8_decode($article->find('h4', 0)->innertext);
$item['uri'] = self::URI . utf8_decode($article->find('a', 0)->href);
$this->msnMondeExtractContent($item['uri'], $item);
$this->items[] = $item;
$limit++;
}
}
$json = json_decode(getContents(self::JSON_URL . $matches['id']), true);
$item['content'] = $json['body'];
if (!empty($json['authors']))
$item['author'] = reset($json['authors'])['name'];
$item['timestamp'] = $json['createdDateTime'];
foreach($json['tags'] as $tag) {
$item['categories'][] = $tag['label'];
}
return $item;
}
}

View File

@@ -3,7 +3,7 @@
class Shimmie2Bridge extends DanbooruBridge {
const NAME = 'Shimmie v2';
const URI = 'https://shimmie.shishnet.org/';
const URI = 'https://shimmie.shishnet.org/v2/';
const DESCRIPTION = 'Returns images from given page';
const PATHTODATA = '.shm-thumb-link';

View File

@@ -10,37 +10,49 @@ class ZenodoBridge extends BridgeAbstract {
public function collectData(){
$html = getSimpleHTMLDOM($this->getURI());
foreach($html->find('div.record-elem.row') as $element) {
foreach($html->find('div.record-elem') as $element) {
$item = array();
$item['uri'] = self::URI . $element->find('h4 > a', 0)->href;
$item['title'] = trim(htmlspecialchars_decode($element->find('h4 > a', 0)->innertext, ENT_QUOTES));
$item['uri'] = self::URI . $element->find('h4', 0)->find('a', 0)->href;
$item['title'] = trim(
htmlspecialchars_decode($element->find('h4', 0)->find('a', 0)->innertext,
ENT_QUOTES
)
);
$authors = $element->find('p', 0);
if ($authors) {
$item['author'] = $authors->plaintext;
$p1 = $element->find('p', 0);
if ($p1) {
foreach ($p1->find('span') as $authors) {
$item['author'] = $item['author'] . $authors . '; ';
}
}
$summary = $element->find('p.hidden-xs > a', 0);
if ($summary) {
$content = $summary->innertext . '<br>';
$p2 = $element->find('p.hidden-xs', 0);
if ($p2) {
$content = $p2->find('a', 0)->innertext . '<br>';
} else {
$content = 'No content';
$content = 'Nope';
}
$type = '<br>Type: ' . $element->find('span.label-default', 0)->innertext;
$item['categories'] = array($element->find('span.label-default', 0)->innertext);
$raw_date = $element->find('small.text-muted', 0)->innertext;
$clean_date = str_replace('Uploaded on ', '', $raw_date);
$clean_date = date_parse(str_replace('Uploaded on ', '', $raw_date));
$content = $content . $raw_date;
$content = $content . date_parse($clean_date);
$item['timestamp'] = $clean_date;
$item['timestamp'] = mktime(
$clean_date['hour'],
$clean_date['minute'],
$clean_date['second'],
$clean_date['month'],
$clean_date['day'],
$clean_date['year']
);
$access = '';
if ($element->find('span.label-success', 0)) {
if ($element->find('span.label-success', 0)->innertext) {
$access = 'Open Access';
} elseif ($element->find('span.label-warning', 0)) {
} elseif ($element->find('span.label-warning', 0)->innertext) {
$access = 'Embargoed Access';
} else {
$access = $element->find('span.label-error', 0)->innertext;

View File

@@ -17,6 +17,6 @@
| ![](https://iplookup.flagfox.net/images/h16/FR.png) | https://rssbridge.boldair.dev | ![](https://img.shields.io/website?down_color=red&down_message=down&up_color=lime&up_message=up&url=https%3A%2F%2Frssbridge.boldair.dev) | [@Boldairdev](https://github.com/Boldairdev) | Latest Github release, Hosted on PHP 8.0 in Roubaix, France |
| ![](https://iplookup.flagfox.net/images/h16/CA.png) | https://rssbridge.bus-hit.me | ![](https://img.shields.io/website/https/rssbridge.bus-hit.me.svg)| [@austinhuang0131](https://austinhuang.me/) | Hosted with Oracle in Québec, Canada |
| ![](https://iplookup.flagfox.net/images/h16/IN.png) | https://rss-bridge.bb8.fun | ![](https://img.shields.io/website/https/rss-bridge.bb8.fun.svg) | [@captn3m0](https://github.com/captn3m0) | Hosted in Bengaluru, India |
| ![](https://iplookup.flagfox.net/images/h16/GB.png) | https://rss-bridge.org/bridge01 | ![](https://img.shields.io/website/https/rss-bridge.org/bridge01.svg) | [@dvikan](https://github.com/dvikan) | London, Digital Ocean|
| ![](https://iplookup.flagfox.net/images/h16/GB.png) | https://rss-bridge.org/bridge01 | ![](https://img.shields.io/website/http/rss-bridge.org/bridge01.svg) | [@dvikan](https://github.com/dvikan) | London, Digital Ocean|
## Inactive instances

View File

@@ -28,7 +28,7 @@ final class Configuration {
*
* @todo Replace this property by a constant.
*/
public static $VERSION = 'dev.2022-06-14';
public static $VERSION = 'dev.2022-06-10';
/**
* Holds the configuration data.