'use strict';

/**
 * @private {!string} _title
 * @private {!string} _headlineSelector
 */
class NewsSite {
    /**
     * @param {!string} title
     * @param {!string} headlineSelectorAll
     * @param {!string} topicAnchorSelector
     */
    constructor(title, headlineSelectorAll, topicAnchorSelector) {
        this._title = title;
        this._headlineSelectorAll = headlineSelectorAll;
        this._topicAnchorSelector = topicAnchorSelector;
    }

    /**
     * @return {!string} News source wiki portal or template title to scrape
     *                   data from
     */
    get title() {
        return this._title;
    }

    /**
     * @return {!string} Query selector for news headline containers (not
     *                   specific categories like deaths, sports, etc)
     */
    get headlineSelectorAll() {
        return this._headlineSelectorAll;
    }

    /**
     * @return {!string} Query selector for news headline subject links; this
     *                   selector should be used on a headline element
     */
    get topicAnchorSelector() {
        return this._topicAnchorSelector;
    }
}

const TOPIC_SELECTOR_LINK = 'a[rel="mw:WikiLink"]:nth-of-type(1)';
const TOPIC_SELECTOR_BOLD_LINK = 'b:nth-of-type(1) a[rel="mw:WikiLink"]';

/**
 * @type {{Object.<string, NewsSite>}} A map of Wikipedia site languages codes
 *                                     to NewsSites
 */
module.exports = {
    da: new NewsSite('Skabelon:Forside_aktuelle_begivenheder', 'div > li',
        TOPIC_SELECTOR_BOLD_LINK),
    de: new NewsSite('Wikipedia:Hauptseite/Aktuelles', 'li', TOPIC_SELECTOR_LINK),
    el: new NewsSite('Πύλη:Τρέχοντα_γεγονότα/Επικεφαλίδες', 'li', TOPIC_SELECTOR_LINK),
    en: new NewsSite('Template:In_the_news', 'ul[id^=mw] li', TOPIC_SELECTOR_BOLD_LINK),
    es: new NewsSite('Portal:Actualidad',
        'table:nth-of-type(1) > tbody > tr > td > ul:nth-of-type(1) > li', TOPIC_SELECTOR_LINK),
    fi: new NewsSite('Malline:Uutisissa', 'body > ul > li', TOPIC_SELECTOR_BOLD_LINK),
    fr: new NewsSite('Modèle:Accueil_actualité', 'div ul[id^=mw] > li', TOPIC_SELECTOR_BOLD_LINK),
    he: new NewsSite('תבנית:חדשות_ואקטואליה', 'body > ul > li', TOPIC_SELECTOR_LINK),
    ko: new NewsSite('틀:새로_들어온_소식', 'body > ul > li', TOPIC_SELECTOR_BOLD_LINK),
    no: new NewsSite('Mal:Aktuelt', 'ul > li', TOPIC_SELECTOR_BOLD_LINK),
    pl: new NewsSite('Szablon:Aktualności', 'ul:last-of-type > li', TOPIC_SELECTOR_BOLD_LINK),
    pt: new NewsSite('Portal:Eventos_atuais', 'table:nth-child(3) ul > li',
        TOPIC_SELECTOR_BOLD_LINK),
    ru: new NewsSite('Шаблон:Актуальные_события', 'body > ul > li', TOPIC_SELECTOR_BOLD_LINK),
    sco: new NewsSite('Template:In_the_news', 'ul[id^=mw] li', TOPIC_SELECTOR_BOLD_LINK), // see en
    sv: new NewsSite('Portal:Huvudsida/Aktuella händelser', 'body > ul > li',
        TOPIC_SELECTOR_BOLD_LINK),
    vi: new NewsSite('Bản_mẫu:Tin_tức', 'ul > li', TOPIC_SELECTOR_BOLD_LINK)
};

@@ -2574,51 +2574,110 @@
     
-ru: new NewsSite('%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%90%D0%BA%D1%82%D1%83%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5_%D1%81%D0%BE%D0%B1%D1%8B%D1%82%D0%B8%D1%8F
+// eslint-disable-next-line max-len%0A    ru: new NewsSite('%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%A2%D0%B5%D0%BA%D1%83%D1%89%D0%B8%D0%B5_%D1%81%D0%BE%D0%B1%D1%8B%D1%82%D0%B8%D1%8F_%D0%BD%D0%B0_%D0%B7%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%BE%D0%B9_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B5
 ', '

Fix ruwiki news template