mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-30 03:20:30 +02:00
Compare commits
7 Commits
2022-06-10
...
2022-06-14
Author | SHA1 | Date | |
---|---|---|---|
|
9503f9ad7f | ||
|
3e2423d86b | ||
|
90e0504da5 | ||
|
4b3b1ca163 | ||
|
5b93bba1a3 | ||
|
b8786da137 | ||
|
166ead902d |
33
README.md
33
README.md
@@ -125,18 +125,20 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [aledeg](https://github.com/aledeg)
|
* [aledeg](https://github.com/aledeg)
|
||||||
* [alex73](https://github.com/alex73)
|
* [alex73](https://github.com/alex73)
|
||||||
* [alexAubin](https://github.com/alexAubin)
|
* [alexAubin](https://github.com/alexAubin)
|
||||||
|
* [Alkarex](https://github.com/Alkarex)
|
||||||
* [AmauryCarrade](https://github.com/AmauryCarrade)
|
* [AmauryCarrade](https://github.com/AmauryCarrade)
|
||||||
* [AntoineTurmel](https://github.com/AntoineTurmel)
|
|
||||||
* [arnd-s](https://github.com/arnd-s)
|
* [arnd-s](https://github.com/arnd-s)
|
||||||
* [ArthurHoaro](https://github.com/ArthurHoaro)
|
* [ArthurHoaro](https://github.com/ArthurHoaro)
|
||||||
* [Astalaseven](https://github.com/Astalaseven)
|
* [Astalaseven](https://github.com/Astalaseven)
|
||||||
* [Astyan-42](https://github.com/Astyan-42)
|
* [Astyan-42](https://github.com/Astyan-42)
|
||||||
|
* [austinhuang0131](https://github.com/austinhuang0131)
|
||||||
* [AxorPL](https://github.com/AxorPL)
|
* [AxorPL](https://github.com/AxorPL)
|
||||||
* [ayacoo](https://github.com/ayacoo)
|
* [ayacoo](https://github.com/ayacoo)
|
||||||
* [az5he6ch](https://github.com/az5he6ch)
|
* [az5he6ch](https://github.com/az5he6ch)
|
||||||
* [b1nj](https://github.com/b1nj)
|
* [b1nj](https://github.com/b1nj)
|
||||||
* [benasse](https://github.com/benasse)
|
* [benasse](https://github.com/benasse)
|
||||||
* [Binnette](https://github.com/Binnette)
|
* [Binnette](https://github.com/Binnette)
|
||||||
|
* [BoboTiG](https://github.com/BoboTiG)
|
||||||
* [Bockiii](https://github.com/Bockiii)
|
* [Bockiii](https://github.com/Bockiii)
|
||||||
* [captn3m0](https://github.com/captn3m0)
|
* [captn3m0](https://github.com/captn3m0)
|
||||||
* [chemel](https://github.com/chemel)
|
* [chemel](https://github.com/chemel)
|
||||||
@@ -162,7 +164,9 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [Dreckiger-Dan](https://github.com/Dreckiger-Dan)
|
* [Dreckiger-Dan](https://github.com/Dreckiger-Dan)
|
||||||
* [drego85](https://github.com/drego85)
|
* [drego85](https://github.com/drego85)
|
||||||
* [drklee3](https://github.com/drklee3)
|
* [drklee3](https://github.com/drklee3)
|
||||||
|
* [DRogueRonin](https://github.com/DRogueRonin)
|
||||||
* [dvikan](https://github.com/dvikan)
|
* [dvikan](https://github.com/dvikan)
|
||||||
|
* [eggwhalefrog](https://github.com/eggwhalefrog)
|
||||||
* [em92](https://github.com/em92)
|
* [em92](https://github.com/em92)
|
||||||
* [eMerzh](https://github.com/eMerzh)
|
* [eMerzh](https://github.com/eMerzh)
|
||||||
* [EtienneM](https://github.com/EtienneM)
|
* [EtienneM](https://github.com/EtienneM)
|
||||||
@@ -176,6 +180,7 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [Frenzie](https://github.com/Frenzie)
|
* [Frenzie](https://github.com/Frenzie)
|
||||||
* [fulmeek](https://github.com/fulmeek)
|
* [fulmeek](https://github.com/fulmeek)
|
||||||
* [ggiessen](https://github.com/ggiessen)
|
* [ggiessen](https://github.com/ggiessen)
|
||||||
|
* [gileri](https://github.com/gileri)
|
||||||
* [Ginko-Aloe](https://github.com/Ginko-Aloe)
|
* [Ginko-Aloe](https://github.com/Ginko-Aloe)
|
||||||
* [girlpunk](https://github.com/girlpunk)
|
* [girlpunk](https://github.com/girlpunk)
|
||||||
* [Glandos](https://github.com/Glandos)
|
* [Glandos](https://github.com/Glandos)
|
||||||
@@ -194,6 +199,7 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [j0k3r](https://github.com/j0k3r)
|
* [j0k3r](https://github.com/j0k3r)
|
||||||
* [JackNUMBER](https://github.com/JackNUMBER)
|
* [JackNUMBER](https://github.com/JackNUMBER)
|
||||||
* [jacquesh](https://github.com/jacquesh)
|
* [jacquesh](https://github.com/jacquesh)
|
||||||
|
* [jakubvalenta](https://github.com/jakubvalenta)
|
||||||
* [JasonGhent](https://github.com/JasonGhent)
|
* [JasonGhent](https://github.com/JasonGhent)
|
||||||
* [jcgoette](https://github.com/jcgoette)
|
* [jcgoette](https://github.com/jcgoette)
|
||||||
* [jdesgats](https://github.com/jdesgats)
|
* [jdesgats](https://github.com/jdesgats)
|
||||||
@@ -205,15 +211,21 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [johnnygroovy](https://github.com/johnnygroovy)
|
* [johnnygroovy](https://github.com/johnnygroovy)
|
||||||
* [johnpc](https://github.com/johnpc)
|
* [johnpc](https://github.com/johnpc)
|
||||||
* [joni1993](https://github.com/joni1993)
|
* [joni1993](https://github.com/joni1993)
|
||||||
|
* [jtojnar](https://github.com/jtojnar)
|
||||||
* [KamaleiZestri](https://github.com/KamaleiZestri)
|
* [KamaleiZestri](https://github.com/KamaleiZestri)
|
||||||
|
* [kkoyung](https://github.com/kkoyung)
|
||||||
* [klimplant](https://github.com/klimplant)
|
* [klimplant](https://github.com/klimplant)
|
||||||
|
* [KN4CK3R](https://github.com/KN4CK3R)
|
||||||
* [kolarcz](https://github.com/kolarcz)
|
* [kolarcz](https://github.com/kolarcz)
|
||||||
* [kranack](https://github.com/kranack)
|
* [kranack](https://github.com/kranack)
|
||||||
* [kraoc](https://github.com/kraoc)
|
* [kraoc](https://github.com/kraoc)
|
||||||
|
* [krisu5](https://github.com/krisu5)
|
||||||
* [l1n](https://github.com/l1n)
|
* [l1n](https://github.com/l1n)
|
||||||
* [laBecasse](https://github.com/laBecasse)
|
* [laBecasse](https://github.com/laBecasse)
|
||||||
* [lagaisse](https://github.com/lagaisse)
|
* [lagaisse](https://github.com/lagaisse)
|
||||||
* [lalannev](https://github.com/lalannev)
|
* [lalannev](https://github.com/lalannev)
|
||||||
|
* [langfingaz](https://github.com/langfingaz)
|
||||||
|
* [lassana](https://github.com/lassana)
|
||||||
* [ldidry](https://github.com/ldidry)
|
* [ldidry](https://github.com/ldidry)
|
||||||
* [Leomaradan](https://github.com/Leomaradan)
|
* [Leomaradan](https://github.com/Leomaradan)
|
||||||
* [leyrer](https://github.com/leyrer)
|
* [leyrer](https://github.com/leyrer)
|
||||||
@@ -232,6 +244,7 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [melangue](https://github.com/melangue)
|
* [melangue](https://github.com/melangue)
|
||||||
* [metaMMA](https://github.com/metaMMA)
|
* [metaMMA](https://github.com/metaMMA)
|
||||||
* [mibe](https://github.com/mibe)
|
* [mibe](https://github.com/mibe)
|
||||||
|
* [mickaelBert](https://github.com/mickaelBert)
|
||||||
* [mightymt](https://github.com/mightymt)
|
* [mightymt](https://github.com/mightymt)
|
||||||
* [mitsukarenai](https://github.com/mitsukarenai)
|
* [mitsukarenai](https://github.com/mitsukarenai)
|
||||||
* [Monocularity](https://github.com/Monocularity)
|
* [Monocularity](https://github.com/Monocularity)
|
||||||
@@ -239,11 +252,14 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [mr-flibble](https://github.com/mr-flibble)
|
* [mr-flibble](https://github.com/mr-flibble)
|
||||||
* [mro](https://github.com/mro)
|
* [mro](https://github.com/mro)
|
||||||
* [mschwld](https://github.com/mschwld)
|
* [mschwld](https://github.com/mschwld)
|
||||||
|
* [muekoeff](https://github.com/muekoeff)
|
||||||
|
* [mw80](https://github.com/mw80)
|
||||||
* [mxmehl](https://github.com/mxmehl)
|
* [mxmehl](https://github.com/mxmehl)
|
||||||
* [Mynacol](https://github.com/Mynacol)
|
* [Mynacol](https://github.com/Mynacol)
|
||||||
* [nel50n](https://github.com/nel50n)
|
* [nel50n](https://github.com/nel50n)
|
||||||
* [niawag](https://github.com/niawag)
|
* [niawag](https://github.com/niawag)
|
||||||
* [Niehztog](https://github.com/Niehztog)
|
* [Niehztog](https://github.com/Niehztog)
|
||||||
|
* [NikNikYkt](https://github.com/NikNikYkt)
|
||||||
* [Nono-m0le](https://github.com/Nono-m0le)
|
* [Nono-m0le](https://github.com/Nono-m0le)
|
||||||
* [obsiwitch](https://github.com/obsiwitch)
|
* [obsiwitch](https://github.com/obsiwitch)
|
||||||
* [Ololbu](https://github.com/Ololbu)
|
* [Ololbu](https://github.com/Ololbu)
|
||||||
@@ -251,18 +267,23 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [otakuf](https://github.com/otakuf)
|
* [otakuf](https://github.com/otakuf)
|
||||||
* [Park0](https://github.com/Park0)
|
* [Park0](https://github.com/Park0)
|
||||||
* [Paroleen](https://github.com/Paroleen)
|
* [Paroleen](https://github.com/Paroleen)
|
||||||
|
* [Patricol](https://github.com/Patricol)
|
||||||
|
* [paulchen](https://github.com/paulchen)
|
||||||
* [PaulVayssiere](https://github.com/PaulVayssiere)
|
* [PaulVayssiere](https://github.com/PaulVayssiere)
|
||||||
* [pellaeon](https://github.com/pellaeon)
|
* [pellaeon](https://github.com/pellaeon)
|
||||||
* [PeterDaveHello](https://github.com/PeterDaveHello)
|
* [PeterDaveHello](https://github.com/PeterDaveHello)
|
||||||
* [Peterr-K](https://github.com/Peterr-K)
|
* [Peterr-K](https://github.com/Peterr-K)
|
||||||
* [Piranhaplant](https://github.com/Piranhaplant)
|
* [Piranhaplant](https://github.com/Piranhaplant)
|
||||||
|
* [pirnz](https://github.com/pirnz)
|
||||||
* [pit-fgfjiudghdf](https://github.com/pit-fgfjiudghdf)
|
* [pit-fgfjiudghdf](https://github.com/pit-fgfjiudghdf)
|
||||||
* [pitchoule](https://github.com/pitchoule)
|
* [pitchoule](https://github.com/pitchoule)
|
||||||
* [pmaziere](https://github.com/pmaziere)
|
* [pmaziere](https://github.com/pmaziere)
|
||||||
* [Pofilo](https://github.com/Pofilo)
|
* [Pofilo](https://github.com/Pofilo)
|
||||||
* [prysme01](https://github.com/prysme01)
|
* [prysme01](https://github.com/prysme01)
|
||||||
|
* [pubak42](https://github.com/pubak42)
|
||||||
* [Qluxzz](https://github.com/Qluxzz)
|
* [Qluxzz](https://github.com/Qluxzz)
|
||||||
* [quentinus95](https://github.com/quentinus95)
|
* [quentinus95](https://github.com/quentinus95)
|
||||||
|
* [quickwick](https://github.com/quickwick)
|
||||||
* [rakoo](https://github.com/rakoo)
|
* [rakoo](https://github.com/rakoo)
|
||||||
* [RawkBob](https://github.com/RawkBob)
|
* [RawkBob](https://github.com/RawkBob)
|
||||||
* [regisenguehard](https://github.com/regisenguehard)
|
* [regisenguehard](https://github.com/regisenguehard)
|
||||||
@@ -271,6 +292,7 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [Roliga](https://github.com/Roliga)
|
* [Roliga](https://github.com/Roliga)
|
||||||
* [ronansalmon](https://github.com/ronansalmon)
|
* [ronansalmon](https://github.com/ronansalmon)
|
||||||
* [rremizov](https://github.com/rremizov)
|
* [rremizov](https://github.com/rremizov)
|
||||||
|
* [s0lesurviv0r](https://github.com/s0lesurviv0r)
|
||||||
* [sal0max](https://github.com/sal0max)
|
* [sal0max](https://github.com/sal0max)
|
||||||
* [sebsauvage](https://github.com/sebsauvage)
|
* [sebsauvage](https://github.com/sebsauvage)
|
||||||
* [shutosg](https://github.com/shutosg)
|
* [shutosg](https://github.com/shutosg)
|
||||||
@@ -278,7 +300,9 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [Simounet](https://github.com/Simounet)
|
* [Simounet](https://github.com/Simounet)
|
||||||
* [somini](https://github.com/somini)
|
* [somini](https://github.com/somini)
|
||||||
* [SpangleLabs](https://github.com/SpangleLabs)
|
* [SpangleLabs](https://github.com/SpangleLabs)
|
||||||
|
* [SqrtMinusOne](https://github.com/SqrtMinusOne)
|
||||||
* [squeek502](https://github.com/squeek502)
|
* [squeek502](https://github.com/squeek502)
|
||||||
|
* [StelFux](https://github.com/StelFux)
|
||||||
* [stjohnjohnson](https://github.com/stjohnjohnson)
|
* [stjohnjohnson](https://github.com/stjohnjohnson)
|
||||||
* [Stopka](https://github.com/Stopka)
|
* [Stopka](https://github.com/Stopka)
|
||||||
* [Strubbl](https://github.com/Strubbl)
|
* [Strubbl](https://github.com/Strubbl)
|
||||||
@@ -291,16 +315,21 @@ Use this script to generate the list automatically (using the GitHub API):
|
|||||||
* [teromene](https://github.com/teromene)
|
* [teromene](https://github.com/teromene)
|
||||||
* [tgkenney](https://github.com/tgkenney)
|
* [tgkenney](https://github.com/tgkenney)
|
||||||
* [thefranke](https://github.com/thefranke)
|
* [thefranke](https://github.com/thefranke)
|
||||||
* [ThePadawan](https://github.com/ThePadawan)
|
|
||||||
* [TheRadialActive](https://github.com/TheRadialActive)
|
* [TheRadialActive](https://github.com/TheRadialActive)
|
||||||
* [theScrabi](https://github.com/theScrabi)
|
* [theScrabi](https://github.com/theScrabi)
|
||||||
* [thezeroalpha](https://github.com/thezeroalpha)
|
* [thezeroalpha](https://github.com/thezeroalpha)
|
||||||
|
* [thibaultcouraud](https://github.com/thibaultcouraud)
|
||||||
* [timendum](https://github.com/timendum)
|
* [timendum](https://github.com/timendum)
|
||||||
* [TitiTestScalingo](https://github.com/TitiTestScalingo)
|
* [TitiTestScalingo](https://github.com/TitiTestScalingo)
|
||||||
* [tomaszkane](https://github.com/tomaszkane)
|
* [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)
|
* [TReKiE](https://github.com/TReKiE)
|
||||||
* [triatic](https://github.com/triatic)
|
* [triatic](https://github.com/triatic)
|
||||||
|
* [User123698745](https://github.com/User123698745)
|
||||||
* [VerifiedJoseph](https://github.com/VerifiedJoseph)
|
* [VerifiedJoseph](https://github.com/VerifiedJoseph)
|
||||||
|
* [vitkabele](https://github.com/vitkabele)
|
||||||
* [WalterBarrett](https://github.com/WalterBarrett)
|
* [WalterBarrett](https://github.com/WalterBarrett)
|
||||||
* [wtuuju](https://github.com/wtuuju)
|
* [wtuuju](https://github.com/wtuuju)
|
||||||
* [xurxof](https://github.com/xurxof)
|
* [xurxof](https://github.com/xurxof)
|
||||||
|
@@ -15,27 +15,15 @@ class KununuBridge extends BridgeAbstract {
|
|||||||
'values' => array(
|
'values' => array(
|
||||||
'Austria' => 'at',
|
'Austria' => 'at',
|
||||||
'Germany' => 'de',
|
'Germany' => 'de',
|
||||||
'Switzerland' => 'ch',
|
'Switzerland' => 'ch'
|
||||||
'United States' => 'us'
|
|
||||||
),
|
),
|
||||||
'exampleValue' => 'de',
|
'exampleValue' => 'de',
|
||||||
),
|
),
|
||||||
'full' => array(
|
|
||||||
'name' => 'Load full article',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'exampleValue' => 'checked',
|
|
||||||
'title' => 'Activate to load full article'
|
|
||||||
),
|
|
||||||
'include_ratings' => array(
|
'include_ratings' => array(
|
||||||
'name' => 'Include ratings',
|
'name' => 'Include ratings',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'title' => 'Activate to include ratings in the feed'
|
'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(
|
'limit' => array(
|
||||||
'name' => 'Limit',
|
'name' => 'Limit',
|
||||||
'type' => 'number',
|
'type' => 'number',
|
||||||
@@ -47,40 +35,27 @@ class KununuBridge extends BridgeAbstract {
|
|||||||
'company' => array(
|
'company' => array(
|
||||||
'name' => 'Company',
|
'name' => 'Company',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'exampleValue' => 'adesso',
|
'exampleValue' => 'kununu',
|
||||||
'title' => 'Insert company name (i.e. Kununu US) or URI path (i.e. kununu-us)'
|
'title' => 'Insert company name (i.e. Kununu) or URI path (i.e. kununu)'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
private $companyName = '';
|
private $companyName = '';
|
||||||
|
|
||||||
public function getURI(){
|
public function getURI() {
|
||||||
if(!is_null($this->getInput('company')) && !is_null($this->getInput('site'))) {
|
if(!is_null($this->getInput('company')) && !is_null($this->getInput('site'))) {
|
||||||
|
|
||||||
$company = $this->fixCompanyName($this->getInput('company'));
|
$company = $this->fixCompanyName($this->getInput('company'));
|
||||||
$site = $this->getInput('site');
|
$site = $this->getInput('site');
|
||||||
$section = '';
|
|
||||||
|
|
||||||
switch($site) {
|
return sprintf('%s%s/%s', self::URI, $site, $company);
|
||||||
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();
|
return parent::getURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName() {
|
||||||
if(!is_null($this->getInput('company'))) {
|
if(!is_null($this->getInput('company'))) {
|
||||||
$company = $this->fixCompanyName($this->getInput('company'));
|
$company = $this->fixCompanyName($this->getInput('company'));
|
||||||
return ($this->companyName ?: $company) . ' - ' . self::NAME;
|
return ($this->companyName ?: $company) . ' - ' . self::NAME;
|
||||||
@@ -93,64 +68,24 @@ class KununuBridge extends BridgeAbstract {
|
|||||||
return 'https://www.kununu.com/favicon-196x196.png';
|
return 'https://www.kununu.com/favicon-196x196.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* All css selectors need rework
|
|
||||||
*/
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$full = $this->getInput('full');
|
$full = $this->getInput('full');
|
||||||
|
|
||||||
// Load page
|
// Load page
|
||||||
$html = getSimpleHTMLDOM($this->getURI());
|
$json = json_decode(getContents($this->getAPI()), true);
|
||||||
|
$this->companyName = $json['common']['name'];
|
||||||
$html = defaultLinkTo($html, static::URI);
|
$baseURI = $this->getURI() . '/bewertung/';
|
||||||
|
|
||||||
// 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;
|
$limit = $this->getInput('limit') ?: 0;
|
||||||
|
|
||||||
// Go through all articles
|
// Go through all articles
|
||||||
foreach($articles as $article) {
|
foreach($json['reviews'] as $review) {
|
||||||
|
|
||||||
$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 = array();
|
||||||
|
$item['author'] = $review['position'] . ' / ' . $review['department'];
|
||||||
$item['author'] = $this->extractArticleAuthorPosition($article);
|
$item['timestamp'] = $review['createdAt'];
|
||||||
$item['timestamp'] = strtotime($date->content);
|
$item['title'] = $review['roundedScore'] . ' : ' . $review['title'];
|
||||||
$item['title'] = $rating->getAttribute('aria-label')
|
$item['uri'] = $baseURI . $review['uuid'];
|
||||||
. ' : '
|
$item['content'] = $this->extractArticleDescription($review);
|
||||||
. 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;
|
$this->items[] = $item;
|
||||||
|
|
||||||
if ($limit > 0 && count($this->items) >= $limit) break;
|
if ($limit > 0 && count($this->items) >= $limit) break;
|
||||||
@@ -158,6 +93,18 @@ 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
|
* Returns a fixed version of the provided company name
|
||||||
*/
|
*/
|
||||||
@@ -172,76 +119,29 @@ class KununuBridge extends BridgeAbstract {
|
|||||||
return preg_replace($umlauts, $replace, $company);
|
return preg_replace($umlauts, $replace, $company);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the position of the author from a given article
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $author_position;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the description from a given article
|
* Returns the description from a given article
|
||||||
*/
|
*/
|
||||||
private function extractArticleDescription($article){
|
private function extractArticleDescription($json){
|
||||||
$description = $article->find('[itemprop=reviewBody]', 0)
|
$retVal = '';
|
||||||
or returnServerError('Cannot find article description!');
|
foreach($json['texts'] as $text) {
|
||||||
|
$retVal .= '<h4>' . $text['id'] . '</h4><p>' . $text['text'] . '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
$retVal = $description->innertext;
|
if($this->getInput('include_ratings') && !empty($json['ratings'])) {
|
||||||
|
|
||||||
if($this->getInput('include_ratings')
|
|
||||||
&& ($ratings = $article->find('.review-ratings .rating-group'))) {
|
|
||||||
$retVal .= (empty($retVal) ? '' : '<hr>') . '<table>';
|
$retVal .= (empty($retVal) ? '' : '<hr>') . '<table>';
|
||||||
foreach($ratings as $rating) {
|
foreach($json['ratings'] as $rating) {
|
||||||
$retVal .= <<<EOD
|
$retVal .= <<<EOD
|
||||||
<tr>
|
<tr>
|
||||||
<td>{$rating->find('.rating-title', 0)->plaintext}
|
<td>{$rating['id']}
|
||||||
<td>{$rating->find('.rating-badge', 0)->plaintext}
|
<td>{$rating['roundedScore']}
|
||||||
|
<td>{$rating['text']}
|
||||||
</tr>
|
</tr>
|
||||||
EOD;
|
EOD;
|
||||||
}
|
}
|
||||||
$retVal .= '</table>';
|
$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;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,36 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
class MsnMondeBridge extends BridgeAbstract {
|
class MsnMondeBridge extends FeedExpander {
|
||||||
|
|
||||||
const MAINTAINER = 'kranack';
|
const MAINTAINER = 'kranack';
|
||||||
const NAME = 'MSN Actu Monde';
|
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 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 getURI(){
|
public function getName() {
|
||||||
return self::URI . 'fr-fr/actualite/monde';
|
return 'MSN Actualités';
|
||||||
}
|
}
|
||||||
|
|
||||||
private function msnMondeExtractContent($url, &$item){
|
public function getURI() {
|
||||||
$html2 = getSimpleHTMLDOM($url);
|
return self::URI;
|
||||||
$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(){
|
public function collectData() {
|
||||||
$html = getSimpleHTMLDOM($this->getURI());
|
$this->collectExpandableDatas(self::FEED_URL, self::LIMIT);
|
||||||
|
}
|
||||||
|
|
||||||
$limit = 0;
|
protected function parseItem($newsItem) {
|
||||||
|
$item = parent::parseItem($newsItem);
|
||||||
// TODO: fix why articles is empty
|
if (!preg_match('#fr-fr/actualite.*/ar-(?<id>[\w]*)\?#', $item['uri'], $matches)) {
|
||||||
foreach($html->find('.smalla') as $article) {
|
return;
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
class Shimmie2Bridge extends DanbooruBridge {
|
class Shimmie2Bridge extends DanbooruBridge {
|
||||||
|
|
||||||
const NAME = 'Shimmie v2';
|
const NAME = 'Shimmie v2';
|
||||||
const URI = 'https://shimmie.shishnet.org/v2/';
|
const URI = 'https://shimmie.shishnet.org/';
|
||||||
const DESCRIPTION = 'Returns images from given page';
|
const DESCRIPTION = 'Returns images from given page';
|
||||||
|
|
||||||
const PATHTODATA = '.shm-thumb-link';
|
const PATHTODATA = '.shm-thumb-link';
|
||||||
|
@@ -10,49 +10,37 @@ class ZenodoBridge extends BridgeAbstract {
|
|||||||
public function collectData(){
|
public function collectData(){
|
||||||
$html = getSimpleHTMLDOM($this->getURI());
|
$html = getSimpleHTMLDOM($this->getURI());
|
||||||
|
|
||||||
foreach($html->find('div.record-elem') as $element) {
|
foreach($html->find('div.record-elem.row') as $element) {
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['uri'] = self::URI . $element->find('h4', 0)->find('a', 0)->href;
|
$item['uri'] = self::URI . $element->find('h4 > a', 0)->href;
|
||||||
$item['title'] = trim(
|
$item['title'] = trim(htmlspecialchars_decode($element->find('h4 > a', 0)->innertext, ENT_QUOTES));
|
||||||
htmlspecialchars_decode($element->find('h4', 0)->find('a', 0)->innertext,
|
|
||||||
ENT_QUOTES
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$p1 = $element->find('p', 0);
|
$authors = $element->find('p', 0);
|
||||||
if ($p1) {
|
if ($authors) {
|
||||||
foreach ($p1->find('span') as $authors) {
|
$item['author'] = $authors->plaintext;
|
||||||
$item['author'] = $item['author'] . $authors . '; ';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$p2 = $element->find('p.hidden-xs', 0);
|
$summary = $element->find('p.hidden-xs > a', 0);
|
||||||
if ($p2) {
|
if ($summary) {
|
||||||
$content = $p2->find('a', 0)->innertext . '<br>';
|
$content = $summary->innertext . '<br>';
|
||||||
} else {
|
} else {
|
||||||
$content = 'Nope';
|
$content = 'No content';
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = '<br>Type: ' . $element->find('span.label-default', 0)->innertext;
|
$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;
|
$raw_date = $element->find('small.text-muted', 0)->innertext;
|
||||||
$clean_date = date_parse(str_replace('Uploaded on ', '', $raw_date));
|
$clean_date = str_replace('Uploaded on ', '', $raw_date);
|
||||||
|
|
||||||
$content = $content . date_parse($clean_date);
|
$content = $content . $raw_date;
|
||||||
|
|
||||||
$item['timestamp'] = mktime(
|
$item['timestamp'] = $clean_date;
|
||||||
$clean_date['hour'],
|
|
||||||
$clean_date['minute'],
|
|
||||||
$clean_date['second'],
|
|
||||||
$clean_date['month'],
|
|
||||||
$clean_date['day'],
|
|
||||||
$clean_date['year']
|
|
||||||
);
|
|
||||||
|
|
||||||
$access = '';
|
$access = '';
|
||||||
if ($element->find('span.label-success', 0)->innertext) {
|
if ($element->find('span.label-success', 0)) {
|
||||||
$access = 'Open Access';
|
$access = 'Open Access';
|
||||||
} elseif ($element->find('span.label-warning', 0)->innertext) {
|
} elseif ($element->find('span.label-warning', 0)) {
|
||||||
$access = 'Embargoed Access';
|
$access = 'Embargoed Access';
|
||||||
} else {
|
} else {
|
||||||
$access = $element->find('span.label-error', 0)->innertext;
|
$access = $element->find('span.label-error', 0)->innertext;
|
||||||
|
@@ -17,6 +17,6 @@
|
|||||||
|  | https://rssbridge.boldair.dev |  | [@Boldairdev](https://github.com/Boldairdev) | Latest Github release, Hosted on PHP 8.0 in Roubaix, France |
|
|  | https://rssbridge.boldair.dev |  | [@Boldairdev](https://github.com/Boldairdev) | Latest Github release, Hosted on PHP 8.0 in Roubaix, France |
|
||||||
|  | https://rssbridge.bus-hit.me | | [@austinhuang0131](https://austinhuang.me/) | Hosted with Oracle in Québec, Canada |
|
|  | https://rssbridge.bus-hit.me | | [@austinhuang0131](https://austinhuang.me/) | Hosted with Oracle in Québec, Canada |
|
||||||
|  | https://rss-bridge.bb8.fun |  | [@captn3m0](https://github.com/captn3m0) | Hosted in Bengaluru, India |
|
|  | https://rss-bridge.bb8.fun |  | [@captn3m0](https://github.com/captn3m0) | Hosted in Bengaluru, India |
|
||||||
|  | http://rss-bridge.org/bridge01 |  | [@dvikan](https://github.com/dvikan) | London, Digital Ocean|
|
|  | https://rss-bridge.org/bridge01 |  | [@dvikan](https://github.com/dvikan) | London, Digital Ocean|
|
||||||
|
|
||||||
## Inactive instances
|
## Inactive instances
|
||||||
|
@@ -28,7 +28,7 @@ final class Configuration {
|
|||||||
*
|
*
|
||||||
* @todo Replace this property by a constant.
|
* @todo Replace this property by a constant.
|
||||||
*/
|
*/
|
||||||
public static $VERSION = 'dev.2022-01-20';
|
public static $VERSION = 'dev.2022-06-14';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the configuration data.
|
* Holds the configuration data.
|
||||||
|
Reference in New Issue
Block a user