From f7af2beb79093432259c67fa5b5315da251512fd Mon Sep 17 00:00:00 2001 From: NikNikYkt <66863608+NikNikYkt@users.noreply.github.com> Date: Fri, 25 Mar 2022 07:32:33 +0900 Subject: [PATCH] WikipediaBridge: Added russian version (#2184) --- bridges/WikipediaBridge.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/bridges/WikipediaBridge.php b/bridges/WikipediaBridge.php index 51971887..df4876d2 100644 --- a/bridges/WikipediaBridge.php +++ b/bridges/WikipediaBridge.php @@ -17,6 +17,7 @@ class WikipediaBridge extends BridgeAbstract { 'exampleValue' => 'English', 'values' => array( 'English' => 'en', + 'Русский' => 'ru', 'Dutch' => 'nl', 'Esperanto' => 'eo', 'French' => 'fr', @@ -266,7 +267,27 @@ class WikipediaBridge extends BridgeAbstract { break; } } - + + + /** + * Implementation for ru.wikipedia.org + */ + private function getContentsEn($html, $subject, $fullArticle){ + switch($subject) { + case WIKIPEDIA_SUBJECT_TFA: + $element = $html->find('div[id=mp-tfa]', 0); + $this->addTodaysFeaturedArticleGeneric($element, $fullArticle, -1); + break; + case WIKIPEDIA_SUBJECT_DYK: + $element = $html->find('div[id=mp-dyk]', 0); + $this->addDidYouKnowGeneric($element, $fullArticle); + break; + default: + break; + } + } + + /** * Implementation for eo.wikipedia.org */