Участник:LEhAN/common.js: различия между версиями

Содержимое удалено Содержимое добавлено
Нет описания правки
отмена правки 111809482 участника LEhAN (обс.)
Метка: замена
 
Строка 5:
importScript('Участник:Мастер теней/Помощник патруля.js');
 
//Удобная ссылка на Викиданные
//дополнения в Викификатор ВО
mw.loader.load("//www.wikidata.org/w/index.php?title=User:Yair rand/WikidataInfo.js&action=raw&ctype=text/javascript");
window.wfWOPlugins = window.wfWOPlugins || [];
window.wfWOPlugins.push(function (txt, r) {
 
//var categories = mw.config.get("wgCategories");
 
var oRequest = new XMLHttpRequest();//загрузка категорий
oRequest.open('GET', 'https://ru.wikipedia.org/w/api.php?format=xml&action=query&prop=categories&cllimit=500&titles=' + mw.config.get('wgPageName'), false);
oRequest.send(null);
categories = oRequest.responseText;
 
if (categories.indexOf('Водные объекты по алфавиту') > -1) {//фиксация протоколов и доменов для ПРО:ВО
r(/http\:\/\/([^\/ \]\n\|\}]+)/g, function ( line, domain ) {//устаревшие http
var TLD = domain.match(/(\.[^\.]+?$)/g);
 
if (domain.indexOf('www.') > -1) {
if (TLD == '.ru') {
line = line.replace(/http\:\/\/www\.(1tv|47news|admgusev|admin-smolensk|ador|allsverige|altairegion22|aqualogo|archaeolog|aroundspb|arsvest|arzamas-city|astrocentr|atomic-energy|bankfax|bashinform|bellona|bfm|bibliokashary|bogorodsk-noginsk|booksite|calend|centrmag|chitalnya|citywalls|domex|dp|dprvrn|e-river|eastrussia|eprussia|factruz|finam|flytourist|fontanka|forbes|gazeta|interfax-russia|interfax|irk|jartour|justmedia|karaoke|kchf|kikonline|klgd|km|kommersant|kp40|kp|kray32|krugosvet|krylatskoye|ks87|kurortmag|lawmix|liveinternet|m24|marshruty|michpravda|mk|mkommunar|moe-online|mokolomyagi|mos|moya-planeta|murman|murmansk\.kp|nakanune|neizvestniy-geniy|newkaliningrad|news29|newsvl|ng|ngpedia|nikatv|nkj|novafish|novgorod|novsu|ntv|oblgazeta|ohotniki|omskinform|ozon|portal-slovo|pravda|pravenc|prima-tv|primpogoda|prirodasibiri|promved|respectme|rfgf|riadagestan|rosbalt|rosmorport|rostov-gorod|rsu\.edu|runivers|rusmuseum|sakhrybvod|sanatoria|scienceforum|sedmitza|shahty|skitalets|smileplanet|sobaka|sobesednik|sodis|sovsport|stav\.kp|tambov\.gov|tatar-inform|terrahumana|tomskneft|tssr|tv21|velorostov|vesti|yuga|zel-veter|zrpress)\.ru/g, 'https://www.$1.ru');
} else if (TLD == '.com') {
line = line.replace(/http\:\/\/www\.(abruzzorafting|advantour|andalucia|antaranews|archeoprovence|artsakhtert|asiaone|austhrutime|azobuild|bbc|best-of-oahu|biomedcentral|boston|businessinsider|businessweek|canaldecarpentras|captaincooksociety|cascobaylines|centralasia-travel|chicagotribune|choosephilippines|dailysabah|dawn|djazairess|dreamlandresort|economist|ekathimerini|elsnorkel|energycentral|esri|etymonline|explore-inverness|fergananews|firstvoices|fleuverhone|foreignpolicy|foxnews|geolink-group|gomadrid|haber3|hookandbullet|hurriyetdailynews|i-gazeta|iexplore|imdb|imeditores|india9|indonesia-tourism|irishtimes|japan-guide|kojaro|kremlin-izmailovo|lacsdespyrenees|lakecity|lakelubbers|lauwersmeer|lesoirdalgerie|lighthousefriends|lntsnl|lonelyplanet|lulu|mayaguez2010|mayanwhitewater|mdpi|merdeka|mobileriverbridge|my-island-jamaica|naturagraeca|naturalhistorymag|nature|netstate|newsru|newyorker|nytimes|oregonlive|orexca|petitfute|planetmountain|poluostrov-krym|primerahora|questia|railwaygazette|raremaps|reachladakh|reuters|roadsideamerica|science-frontiers|sciencedaily|sciencedirect|search|sfgate|showcaves|shukach|silkadv|solomontimes|startribune|statesmanjournal|stonewallresort|tamilnet|tandfonline|tasfish|thefishinguide|thejakartapost|theoi|thequinnipiacriver|timesofisrael|travelponce|tribunnews|usinflationcalculator|vanguardia|visitnapavalley|volynnews|vtourisme|watertonbiosphere|waymarking|weekendnotes|who2|wondermondo|wordaz|world-of-waterfalls|wral|yosemitehikes|zemlya-chita)\.com/g, 'https://www.$1.com');
} else if (TLD == '.org') {
line = line.replace(/http\:\/\/www\.(afdb|alaska|alexanderyakovlev|arocha|brik|bulgariatravel|centralparknyc|climatecentral|dadvail|dbnl|ecolur|eenorthcarolina|eib|fortross|foundsf|geographic|gezitter|globalnature|globalsecurity|historylink|igkb|indiansworld|international\.icomos|internationalrivers|isprs|iucnredlist|jewishvirtuallibrary|klamathbucketbrigade|kootenairivernetwork|michigan|newworldencyclopedia|nwcouncil|oen-iad|opb|openstreetmap|pnas|riob|russhanson|sandyriver|sciencemag|seagrasswatch|serafimovich|sprep|travelandbeyond|un|unhcr|visitpinedale|wdcs|wdl|worldfishcenter)\.org/g, 'https://www.$1.org');
} else if (TLD == '.de') {
line = line.replace(/http\:\/\/www\.(ad-hoc-news|ak-kurier|anstageslicht|fgg-elbe|ganz-muenchen|heringstage-kappeln|hl-cruises|hnd\.bayern|hopla-main|krautheim|kreis-viersen|lanuv\.nrw|lfu\.bayern|lvz|markt-oberstdorf|nabu-waldeck-frankenberg|netzangler|oberstdorf-lexikon|op-marburg|retrobibliothek|route-industriekultur|ruhrnachrichten|schloesser\.bayern|siegener-zeitung|spiegel|stadtentwicklung\.berlin|tim-online\.nrw|umweltbundesamt|umweltkarten-niedersachsen|wwa-ke\.bayern|zeit)\.de/g, 'https://www.$1.de');
} else if (TLD == '.gov') {
line = line.replace(/http\:\/\/www\.(blm|dec\.ny|dnr\.sc|dnr\.wa|eia|fws|jpl\.nasa|loc|maine|michigan|ncgc\.nrcs\.usda|nps|nsf|nwfsc\.noaa|oregon|recreation|rivers|umesc\.usgs)\.gov/g, 'https://www.$1.gov');
} else if (TLD == '.au') {
line = line.replace(/http\:\/\/www\.(abc\.net|abs\.gov|alpa\.asn|bogan\.nsw\.gov|brisbanetimes\.com|environment\.nsw\.gov|gnb\.nsw\.gov|hydro\.com|nationalparks\.nsw\.gov|parks\.tas\.gov|parliament\.tas\.gov|smh\.com|tasmaniacampers\.com|theage\.com|utas\.edu|warwyn\.tas\.gov|wettropics\.gov|wilderness\.org)\.au/g, 'https://www.$1.au');
} else if (TLD == '.net') {
line = line.replace(/http\:\/\/www\.(adv-geosci|bgglobe|bor030|ckfiumi|cosis|dagtravel|embalses|gramota|hydrol-earth-syst-sci|mangupa|patagonias|reabic|sci-dril|the-cryosphere-discuss|the-cryosphere)\.net/g, 'https://www.$1.net');
} else if (TLD == '.uk') {
line = line.replace(/http\:\/\/www\.(4ni\.co|bbc\.co|dailymail\.co|dailypost\.co|dailyrecord\.co|english-heritage\.org|geo\.ed\.ac|legendarydartmoor\.co|megalithic\.co|nesbiodiversity\.org|rspb\.org|swansea\.ac|telegraph\.co|visionofbritain\.org)\.uk/g, 'https://www.$1.uk');
} else if (TLD == '.fr') {
line = line.replace(/http\:\/\/www\.(annuaire-mairie|geoportail\.gouv|larousse|lemonde|persee|rfi|siabave|sudouest)\.fr/g, 'https://www.$1.fr');
} else if (TLD == '.ca') {
line = line.replace(/http\:\/\/www\.(cbc|earthquakescanada\.nrcan\.gc|greatersudbury|hc-sc\.gc|pc\.gc|qtcommission|thecanadianencyclopedia|toronto)\.ca/g, 'https://www.$1.ca');
} else if (TLD == '.ua') {
line = line.replace(/http\:\/\/www\.(eurointegration\.com|gorod\.cn|phototravel\.dp|telegraf\.in|terra-tavrika\.com|tkg\.org|umj\.com)\.ua/g, 'https://www.$1.ua');
} else if (TLD == '.kz') {
line = line.replace(/http\:\/\/www\.(diapazon|inform|ktk|ng|np|nur|zakon)\.kz/g, 'https://www.$1.kz');
} else if (TLD == '.nz') {
line = line.replace(/http\:\/\/www\.(doc\.govt|geonet\.org|nzherald\.co|odt\.co|stuff\.co|teara\.govt|waimangu\.co)\.nz/g, 'https://www.$1.nz');
} else if (TLD == '.by') {
line = line.replace(/http\:\/\/www\.(belarus|belta|kp|minpriroda\.gov|pravo|tio)\.by/g, 'https://www.$1.by');
} else if (TLD == '.ch') {
line = line.replace(/http\:\/\/www\.(aargauerzeitung|bafu\.admin|gebrueder-duerst|peter-hug|swisseduc|swissinfo)\.ch/g, 'https://www.$1.ch');
} else if (TLD == '.edu') {
line = line.replace(/http\:\/\/www\.(academia|csi|ldeo\.columbia|lib\.utexas|uaf)\.edu/g, 'https://www.$1.edu');
} else if (TLD == '.info') {
line = line.replace(/http\:\/\/www\.(activestudy|amur|azov|nepjol|scottish-places)\.info/g, 'https://www.$1.info');
} else if (TLD == '.no') {
line = line.replace(/http\:\/\/www\.(baroniet|nrk|sognefjord|ssb|yr)\.no/g, 'https://www.$1.no');
} else if (TLD == '.gr') {
line = line.replace(/http\:\/\/www\.(giannitsa|nhmc\.uoc|statistics|tovima|vimaonline)\.gr/g, 'https://www.$1.gr');
} else if (TLD == '.lv') {
line = line.replace(/http\:\/\/www\.(daba\.gov|dziedava|ezeri|lu)\.lv/g, 'https://www.$1.lv');
} else if (TLD == '.es') {
line = line.replace(/http\:\/\/www\.(chguadalquivir|chminosil|diariodejerez|elmundo)\.es/g, 'https://www.$1.es');
} else if (TLD == '.us') {
line = line.replace(/http\:\/\/www\.(fs\.fed|geodata|govtrack)\.us/g, 'https://www.$1.us');
} else if (TLD == '.fi') {
line = line.replace(/http\:\/\/www\.(karjalankartat|luontoon|ymparisto)\.fi/g, 'https://www.$1.fi');
} else if (TLD == '.ar') {
line = line.replace(/http\:\/\/www\.(ign\.gob|ina\.gob|lanacion\.com)\.ar/g, 'https://www.$1.ar');
} else if (TLD == '.jp') {
line = line.replace(/http\:\/\/www\.(ktr\.mlit\.go|mlit\.go|yamanashi-kankou)\.jp/g, 'https://www.$1.jp');
} else if (TLD == '.cz') {
line = line.replace(/http\:\/\/www\.(ceskatelevize|priroda|zacler)\.cz/g, 'https://www.$1.cz');
} else if (TLD == '.hr') {
line = line.replace(/http\:\/\/www\.(dzs|enciklopedija)\.hr/g, 'https://www.$1.hr');
} else if (TLD == '.ee') {
line = line.replace(/http\:\/\/www\.(kalapeedia|loodusajakiri)\.ee/g, 'https://www.$1.ee');
} else if (TLD == '.su') {
line = line.replace(/http\:\/\/www\.(mke|nomad)\.su/g, 'https://www.$1.su');
} else if (TLD == '.kg') {
line = line.replace(/http\:\/\/www\.(msn|open)\.kg/g, 'https://www.$1.kg');
} else if (TLD == '.id') {
line = line.replace(/http\:\/\/www\.(mongabay\.co|pu\.go)\.id/g, 'https://www.$1.id');
} else if (TLD == '.nl') {
line = line.replace(/http\:\/\/www\.(netherlandsnavy|rijkswaterstaat)\.nl/g, 'https://www.$1.nl');
} else if (TLD == '.br') {
line = line.replace(/http\:\/\/www\.(ferias\.tur|scielo)\.br/g, 'https://www.$1.br');
} else if (TLD == '.ie') {
line = line.replace(/http\:\/\/www\.(independent|ucc)\.ie/g, 'https://www.$1.ie');
} else if (TLD == '.se') {
line = line.replace(/http\:\/\/www\.(ccb|umea)\.se/g, 'https://www.$1.se');
} else if (TLD == '.biz') {
line = line.replace(/http\:\/\/www\.(afanasy)\.biz/g, 'https://www.$1.biz');
} else if (TLD == '.ge') {
line = line.replace(/http\:\/\/www\.(apsny)\.ge/g, 'https://www.$1.ge');
} else if (TLD == '.am') {
line = line.replace(/http\:\/\/www\.(cadastre)\.am/g, 'https://www.$1.am');
} else if (TLD == '.bg') {
line = line.replace(/http\:\/\/www\.(economic)\.bg/g, 'https://www.$1.bg');
} else if (TLD == '.cat') {
line = line.replace(/http\:\/\/www\.(enciclopedia)\.cat/g, 'https://www.$1.cat');
} else if (TLD == '.uz') {
line = line.replace(/http\:\/\/www\.(gazeta)\.uz/g, 'https://www.$1.uz');
} else if (TLD == '.tt') {
line = line.replace(/http\:\/\/www\.(guardian\.co)\.tt/g, 'https://www.$1.tt');
} else if (TLD == '.ph') {
line = line.replace(/http\:\/\/www\.(haribon\.org)\.ph/g, 'https://www.$1.ph');
} else if (TLD == '.tr') {
line = line.replace(/http\:\/\/www\.(hurriyet\.com)\.tr/g, 'https://www.$1.tr');
} else if (TLD == '.sk') {
line = line.replace(/http\:\/\/www\.(juls\.savba)\.sk/g, 'https://www.$1.sk');
} else if (TLD == '.lt') {
line = line.replace(/http\:\/\/www\.(kedainiutvic)\.lt/g, 'https://www.$1.lt');
} else if (TLD == '.uy') {
line = line.replace(/http\:\/\/www\.(mnhn\.gub)\.uy/g, 'https://www.$1.uy');
} else if (TLD == '.is') {
line = line.replace(/http\:\/\/www\.(nat)\.is/g, 'https://www.$1.is');
} else if (TLD == '.il') {
line = line.replace(/http\:\/\/www\.(newsru\.co)\.il/g, 'https://www.$1.il');
} else if (TLD == '.cr') {
line = line.replace(/http\:\/\/www\.(scielo\.sa)\.cr/g, 'https://www.$1.cr');
} else if (TLD == '.si') {
line = line.replace(/http\:\/\/www\.(stat)\.si/g, 'https://www.$1.si');
} else if (TLD == '.at') {
line = line.replace(/http\:\/\/www\.(tirol\.gv)\.at/g, 'https://www.$1.at');
} else if (TLD == '.az') {
line = line.replace(/http\:\/\/www\.(tourism)\.az/g, 'https://www.$1.az');
} else if (TLD == '.eu') {
line = line.replace(/http\:\/\/www\.(usinsk)\.eu/g, 'https://www.$1.eu');
}
}
else
{
if (TLD == '.ru') {
line = line.replace(/http\:\/\/(water-rf|rg|region\.tverlib|nature\.baikal|lenta|regnum|ogv\.karelia|ria|cyberleninka|tass|rutraveller|primpogoda|nedradv|valentin-nuzhdenko|img-fotki\.yandex|gazetazp|archaeology\.nsc|bigenc|news\.vtomske|izhlife|zaimka|aif|aquavedia|webmineral|websprav\.admin-smolensk|arhpress|portnews|skitalets|nvo\.ng|altapress|vao\.mos|kuzrab|yaruuna|elementy|bvf|sobory|chelindustry|dront|ankerch-crimea|mapdata|pomorie|mapsoid|gazeta-bibirevo|msh\.rk\.gov|moluch|mediaryazan|russian7|rus-shipping|tikhvin\.spb|pandia|peterhof|primamedia|pravdapfo|terijoki\.spb|rostov\.aif|newtimes|textarchive|nsportal|gkvod\.rk\.gov|gazeta-altufievo|crimeaz|nat-geo|mepar|crimea-map\.msk|expoclub|dvkapital|fedpress|big-rostov|360tv|bashinform|cheaptravelling|zuzino\.mos|zodorov|akvarel|zakonbase|esus|zebra-tv|drogganoye\.tatarstan|burouu|mhealth|mk\.tula|proon\.rpn\.gov|tinaocenter|v4\.udsu|menzelinsk\.tatarstan|mid|tukay\.tatarstan|rscf|perm\.aif|urochishe|v102|visitkolyma|vladnews|vm|webanan|phototravelguide|fotki\.yandex|gdekluet|geraldika|gorodperm|gssm|gudodd|justmedia|mos|new\.runivers|nnov\.aif|wwf|logyhova\.ucoz|les\.admin-smolensk|lib\.rgo|lib\.znate|lipetsknews|lawrussia|mayaksbor|meco\.rk\.gov|megaribolov|minleshoz\.tatarstan|kladr-rf|k12\.ucoz|kam-kray|kamchatka\.aif|kandid|kartravel|kazanreporter|kirovkosmo\.ucoz)\.ru/g, 'https://$1.ru');
line = line.replace(/http\:\/\/(kpfu|kprf|kuban\.aif|kurort\.yuga|kuzpress|mossovetinfo|pravdaurfo|perovo\.mos|piterhunt|po-krymu|kuzbasslegends|portal-kultura|posibiri|pravitelstvo\.kbr|pravoslavnoe-duhovenstvo|progulkipomoskve|realty\.interfax|redbookrf|renewables|otdih\.nakubani|moxnpn|nevasport|muob|naenisee|nashaucheba|nason|nekrasovka\.mos|news\.ngs|news\.ykt|nkvd\.tomsk|nmusino\.ucoz|nord-news|nowch-agu\.ucoz|nsk\.aif|nsk\.sibnovosti|bloknot-taganrog|canalmoscow|catalogmineralov|belogorsk-leshoz|classes|crimea\.ria|cyrillitsa|dela|delvaneo|destinations|27r|4x4pohod|agidel|allinformcrimea\.ucoz|altufievo\.mos|baimvestnik\.ucoz|ansya|askimam|atv\.ucoz|baikal-tourist|hunter63|goroder|gorodn|gudok|h\.120-bal|housecomputer|hramy|i-fakt|ib\.komisc|indonet|informing|inosmi|irkobl|istina\.msu|gnkk|dlib\.rsl|dni|drevo-info|drugoigorod|earth-chronicles|echo\.msk|eco\.tatarstan|elibrary\.unatlib|gbusc44\.mos|expert|fastpic|feotoday|fishnews|fishspace|fleetphoto|fotomiy|fototerra|riac34|rostov-na-donu\.tendermedia|toryal|svao\.mos|svyar|tarif\.gov-murman|tatarstan|sudact|tula\.aif|tuomi\.ucoz|turfront|tverzem|u7a|ufa1|survincity|statehistory|rucont|rulaws|russian-church|rv6bc\.ucoz|samstar-biblio\.ucoz|sanatorii-rush|shkolazhizni|shlychkov|sk-news|soldatru|spb\.aif|stapravda|uletay7\.ucoz|uraloved|urban3p|vestikavkaza|vestirama|vlad\.aif|vostok\.mskobr|vz|wiki-linki|womanadvice)\.ru/g, 'https://$1.ru');
} else if (TLD == '.com') {
line = line.replace(/http\:\/\/(jalita|mappingsupport|kafanews|geo-mexico|edition\.cnn|supreme\.justia|sarinform|shurigin\.livejournal|b-port|silkadv|regional\.kompas|foto-planeta|crimeanblog\.blogspot|caselaw\.lp\.findlaw|eastcoasthiker|bse\.slovaronline|all-about-uk\.blogspot|zeenews\.india|xmission|oxfordbusinessgroup|bali\.bisnis|josephoregon|link\.springer|ru\.krymr|safari-ukraina|tasmania|traveloregon|webmandry|worldmaritimenews|facenama|finance\.detik|geographyofrussia|hamgardi|lipsus\.kompas|ma\.usharbors|mariuver\.wordpress|news\.liputan6|ws\.iwaponline|lg-region|mapsnmaps\.blogspot|maxpark|latimesblogs\.latimes|modelman\.livejournal|kalteng\.tribunnews|konservasidasciliwung\.wordpress|kuluarpohod|kuznetsov-ru\.livejournal|lagochapo\.wordpress|pih-pih\.livejournal)\.com/g, 'https://$1.com');
line = line.replace(/http\:\/\/(polpred|okulovka|rezeknenka\.livejournal|moya-moskva\.livejournal|nedov\.livejournal|ochakovo\.livejournal|news\.blogs\.cnn|centralasia-adventures|calwatchdog|canterburyphotography\.blogspot|crookedlakereview|3planeta|albertawater|alonestalker\.livejournal|anapacity|ant-ufa|archive\.aramcoworld|baike\.baidu|hero\.izmail-city|himalman\.wordpress|hipersia|globalsib|ic\.pics\.livejournal|indahnesia|irina-from-kiev\.livejournal|diurna-sib\.livejournal|economic-definition|eventseeker|syzran\.ucoz|tastracks\.webs|terra-z|travel\.kompas|travel\.sakh|turkgeonews\.wordpress|ufa-gid|schwaebischealbnatur\.blogspot|saiga20k\.livejournal|sergey-mironov\.livejournal|slovar-vocab|smorodina|spravka-jurist|vladivostok\.livejournal|v-georgia|vahemart\.livejournal|varyadavydova|vkalmykii|vodnyjmir\.wordpress|workmall)\.com/g, 'https://$1.com');
} else if (TLD == '.org') {
line = line.replace(/http\:\/\/(aem\.asm|anadyr|archive|ascelibrary|assets\.panda|bioone|buxara|catalog\.hathitrust|caves|cmiae|commons\.wikimedia|csis|damba|de\.wikisource|documents\.worldbank|dx\.doi|en\.climate-data|esys|fr\.climate-data|geosfera|journals\.cambridge|journals\.plos|komtv|mcnyblog|meetingorganizer\.copernicus|pagetour|rsos\.royalsocietypublishing|rsta\.royalsocietypublishing|ru\.climate-data|ru\.convdocs|rus\.ozodlik|science\.sciencemag|swordmaster|trnerr|unesdoc\.unesco|upload\.wikimedia|visitidaho|web-japan|woodape)\.org/g, 'https://$1.org');
} else if (TLD == '.ua') {
line = line.replace(/http\:\/\/(analitika\.at|ayia\.at|bereznyaki\.at|chtyvo\.org|crimea\.vgorode|gazeta\.zp|genichesk\.com|infodon\.org|jankoy\.org|narodna\.pravda\.com|nash-kirim\.at|news\.finance|shron1\.chtyvo\.org|sud|visnyk\.lutsk|visti\.ks|weather\.in|who-is-who|wildtour\.com|zabytki\.in|zakon\.rada\.gov)\.ua/g, 'https://$1.ua');
} else if (TLD == '.gov') {
line = line.replace(/http\:\/\/(antarcticsun\.usap|ca\.water\.usgs|charts\.noaa|dggs\.alaska|earthobservatory\.nasa|geomaps\.wr\.usgs|iaspub\.epa|library\.alaska|neo\.sci\.gsfc\.nasa|nhd\.usgs|nwis\.waterdata\.usgs|or\.water\.usgs|pr\.water\.usgs|pubs\.usgs|sanctuaries\.noaa|tn\.water\.usgs|vulcan\.wr\.usgs|water\.usgs|waterdata\.usgs|wdr\.water\.usgs)\.gov/g, 'https://$1.gov');
} else if (TLD == '.info') {
line = line.replace(/http\:\/\/(academ|anapa|brest\.greenbelarus|city-pages|iahs|koleco|odintsovo|ru-ecology|ruslo|visitdonbass)\.info/g, 'https://$1.info');
} else if (TLD == '.edu') {
line = line.replace(/http\:\/\/(astro\.cornell|dsal\.uchicago|geoinfo\.nmt|ir\.library\.oregonstate|museum\.unc|nmgs\.nmt|oceancurrents\.rsmas\.miami|quod\.lib\.umich|serc\.carleton|volcano\.si)\.edu/g, 'https://$1.edu');
} else if (TLD == '.kz') {
line = line.replace(/http\:\/\/(atau|blog\.autoatlas|express-k|forbes|incident\.zakon|kolesa|library\.psu|mk-kz|news\.nur)\.kz/g, 'https://$1.kz');
} else if (TLD == '.net') {
line = line.replace(/http\:\/\/(angara|lg-news|lifeglobe|news\.allcrimea|region33\.ucoz|texasbeyondhistory|tourlib|wasserblick|zonakz)\.net/g, 'https://$1.net');
} else if (TLD == '.by') {
line = line.replace(/http\:\/\/(beldumka\.belta|beltur|interfax|news\.21|orda\.of|pravo|regiony|rgazeta)\.by/g, 'https://$1.by');
} else if (TLD == '.de') {
line = line.replace(/http\:\/\/(denkxweb\.denkmalpflege-hessen|geoportal\.bayern|leinbachtal|rips-dienste\.lubw\.baden-wuerttemberg|ru\.poezdka|tu-dresden|udo\.lubw\.baden-wuerttemberg|www1\.wdr)\.de/g, 'https://$1.de');
} else if (TLD == '.ch') {
line = line.replace(/http\:\/\/(hls-dhs-dss|map\.geo\.admin|nashagazeta|postconflict\.unep|rheinfall|www4\.ti)\.ch/g, 'https://$1.ch');
} else if (TLD == '.au') {
line = line.replace(/http\:\/\/(coloriver\.com|dpipwe\.tas\.gov|epa\.tas\.gov|eprints\.utas\.edu|lcsc\.org)\.au/g, 'https://$1.au');
} else if (TLD == '.su') {
line = line.replace(/http\:\/\/(ecoportal|nomad|sibirica|skr|vkrym)\.su/g, 'https://$1.su');
} else if (TLD == '.nz') {
line = line.replace(/http\:\/\/(maoridictionary\.co|paperspast\.natlib\.govt|rivers\.org|royalsociety\.org|teara\.govt)\.nz/g, 'https://$1.nz');
} else if (TLD == '.ca') {
line = line.replace(/http\:\/\/(albertaparks|journals\.sfu|laws-lois\.justice\.gc|meteor\.uwo)\.ca/g, 'https://$1.ca');
} else if (TLD == '.pl') {
line = line.replace(/http\:\/\/(literat\.ug\.edu|mapy\.geoportal\.gov|stat\.gov|z-ne)\.pl/g, 'https://$1.pl');
} else if (TLD == '.eu') {
line = line.replace(/http\:\/\/(balticmaps|ec\.europa|lake-cerne-jezero\.czech-mountains|natura2000\.eea\.europa)\.eu/g, 'https://$1.eu');
} else if (TLD == '.ee') {
line = line.replace(/http\:\/\/(journalist\.delfi|loodusegakoos|register\.muinas|vm)\.ee/g, 'https://$1.ee');
} else if (TLD == '.fi') {
line = line.replace(/http\:\/\/(blogs\.helsinki|julkaisut\.metsa|wwf|yle)\.fi/g, 'https://$1.fi');
} else if (TLD == '.uz') {
line = line.replace(/http\:\/\/(lex|podrobno|stroyka|ziyouz)\.uz/g, 'https://$1.uz');
} else if (TLD == '.tv') {
line = line.replace(/http\:\/\/(ekburg|gorod-plus|rybalka)\.tv/g, 'https://$1.tv');
} else if (TLD == '.is') {
line = line.replace(/http\:\/\/(grapevine|invest\.skagafjordur|timarit)\.is/g, 'https://$1.is');
} else if (TLD == '.vn') {
line = line.replace(/http\:\/\/(archive|vietnam\.vnanet)\.vn/g, 'https://$1.vn');
} else if (TLD == '.fr') {
line = line.replace(/http\:\/\/(chrono-environnement\.univ-fcomte|eolehna1\.assoc\.pagespro-orange)\.fr/g, 'https://$1.fr');
} else if (TLD == '.md') {
line = line.replace(/http\:\/\/(aif|esp)\.md/g, 'https://$1.md');
} else if (TLD == '.uk') {
line = line.replace(/http\:\/\/(etheses\.bham\.ac|nrfa\.ceh\.ac)\.uk/g, 'https://$1.uk');
} else if (TLD == '.sk') {
line = line.replace(/http\:\/\/(klubina|presov\.dnes24)\.sk/g, 'https://$1.sk');
} else if (TLD == '.be') {
line = line.replace(/http\:\/\/(users\.ugent|verslagenenmededelingen)\.be/g, 'https://$1.be');
} else if (TLD == '.id') {
line = line.replace(/http\:\/\/(bem\.feb\.ugm\.ac)\.id/g, 'https://$1.id');
} else if (TLD == '.cl') {
line = line.replace(/http\:\/\/(biblioteca\.sernageomin)\.cl/g, 'https://$1.cl');
} else if (TLD == '.int') {
line = line.replace(/http\:\/\/(cdm\.unfccc)\.int/g, 'https://$1.int');
} else if (TLD == '.mk') {
line = line.replace(/http\:\/\/(daily)\.mk/g, 'https://$1.mk');
} else if (TLD == '.in') {
line = line.replace(/http\:\/\/(ddinajpur\.nic)\.in/g, 'https://$1.in');
} else if (TLD == '.fm') {
line = line.replace(/http\:\/\/(euroradio)\.fm/g, 'https://$1.fm');
} else if (TLD == '.hr') {
line = line.replace(/http\:\/\/(hrcak\.srce)\.hr/g, 'https://$1.hr');
} else if (TLD == '.dk') {
line = line.replace(/http\:\/\/(ing)\.dk/g, 'https://$1.dk');
} else if (TLD == '.lv') {
line = line.replace(/http\:\/\/(jauns)\.lv/g, 'https://$1.lv');
} else if (TLD == '.tr') {
line = line.replace(/http\:\/\/(journals\.tubitak\.gov)\.tr/g, 'https://$1.tr');
} else if (TLD == '.life') {
line = line.replace(/http\:\/\/(karpaty)\.life/g, 'https://$1.life');
} else if (TLD == '.kg') {
line = line.replace(/http\:\/\/(knews)\.kg/g, 'https://$1.kg');
} else if (TLD == '.lt') {
line = line.replace(/http\:\/\/(kvr\.kpd)\.lt/g, 'https://$1.lt');
} else if (TLD == '.name') {
line = line.replace(/http\:\/\/(laspi)\.name/g, 'https://$1.name');
} else if (TLD == '.lu') {
line = line.replace(/http\:\/\/(map\.geoportail)\.lu/g, 'https://$1.lu');
} else if (TLD == '.tm') {
line = line.replace(/http\:\/\/(metbugat\.gov)\.tm/g, 'https://$1.tm');
} else if (TLD == '.za') {
line = line.replace(/http\:\/\/(mopanebushlodge\.co)\.za/g, 'https://$1.za');
} else if (TLD == '.pt') {
line = line.replace(/http\:\/\/(natural)\.pt/g, 'https://$1.pt');
} else if (TLD == '.il') {
line = line.replace(/http\:\/\/(parks\.org)\.il/g, 'https://$1.il');
} else if (TLD == '.br') {
line = line.replace(/http\:\/\/(periodicoscientificos\.ufmt)\.br/g, 'https://$1.br');
} else if (TLD == '.cz') {
line = line.replace(/http\:\/\/(plzen\.idnes)\.cz/g, 'https://$1.cz');
} else if (TLD == '.rs') {
line = line.replace(/http\:\/\/(pod2\.stat\.gov)\.rs/g, 'https://$1.rs');
} else if (TLD == '.ar') {
line = line.replace(/http\:\/\/(ri\.conicet\.gov)\.ar/g, 'https://$1.ar');
} else if (TLD == '.es') {
line = line.replace(/http\:\/\/(riubu\.ubu)\.es/g, 'https://$1.es');
} else if (TLD == '.ir') {
line = line.replace(/http\:\/\/(seeiran)\.ir/g, 'https://$1.ir');
} else if (TLD == '.at') {
line = line.replace(/http\:\/\/(tirolatlas\.uibk\.ac)\.at/g, 'https://$1.at');
} else if (TLD == '.today') {
line = line.replace(/http\:\/\/(tv2)\.today/g, 'https://$1.today');
} else if (TLD == '.jp') {
line = line.replace(/http\:\/\/(wldb\.ilec\.or)\.jp/g, 'https://$1.jp');
}
}
return line;
});
 
 
r(/https?\:\/\/(www\.[^\/ \]\n\|\}]+)/g, function ( line, domain ) {//устаревшие www
var TLD = domain.match(/(\.[^\.]+?$)/g);
 
if (TLD == '.ru') {
line = line.replace(/\:\/\/www\.(6tv|crimea|moya-planeta|online812|pandia|proza|retromap|risk|saynytour|zenon74)\.ru/g, '://$1.ru');
} else if (TLD == '.com') {
line = line.replace(/\:\/\/www\.(dolgoprudny|hawaii247|jamaicablackriver|library\.eb|pacificwrecks|utalii)\.com/g, '://$1.com');
} else if (TLD == '.org') {
line = line.replace(/\:\/\/www\.(archive|iranicaonline|stratigraphy)\.org/g, '://$1.org');
} else if (TLD == '.au') {
line = line.replace(/\:\/\/www\.(ausemade\.com|sahof\.org)\.au/g, '://$1.au');
} else if (TLD == '.su') {
line = line.replace(/\:\/\/www\.(cubatravel|egypttravel)\.su/g, '://$1.su');
} else if (TLD == '.se') {
line = line.replace(/\:\/\/www\.(ep\.liu|helagotland)\.se/g, '://$1.se');
} else if (TLD == '.uk') {
line = line.replace(/\:\/\/www\.(canalplan\.org)\.uk/g, '://$1.uk');
} else if (TLD == '.kz') {
line = line.replace(/\:\/\/www\.(diapazon)\.kz/g, '://$1.kz');
} else if (TLD == '.is') {
line = line.replace(/\:\/\/www\.(edgeofthearctic)\.is/g, '://$1.is');
} else if (TLD == '.us') {
line = line.replace(/\:\/\/www\.(evostc\.state\.ak)\.us/g, '://$1.us');
} else if (TLD == '.name') {
line = line.replace(/\:\/\/www\.(gako)\.name/g, '://$1.name');
} else if (TLD == '.de') {
line = line.replace(/\:\/\/www\.(istanbulpark)\.de/g, '://$1.de');
} else if (TLD == '.it') {
line = line.replace(/\:\/\/www\.(va\.minambiente)\.it/g, '://$1.it');
} else if (TLD == '.ua') {
line = line.replace(/\:\/\/www\.(vodgosp\.kherson)\.ua/g, '://$1.ua');
} else if (TLD == '.edu') {
line = line.replace(/\:\/\/www\.(wou)\.edu/g, '://$1.edu');
}
 
return line;
});
} else if (categories.indexOf('Природные географические объекты по алфавиту') > -1) {//фиксация протоколов и доменов для ПРО:Физгео
r(/http\:\/\/([^\/ \]\n\|\}]+)/g, function ( line, domain ) {//устаревшие http
var TLD = domain.match(/(\.[^\.]+?$)/g);
 
if (domain.indexOf('www.') > -1) {
if (TLD == '.com') {
line = line.replace(/http\:\/\/www\.(peakbagger|bbc|nature|mountain-forecast|sciencedirect|newsru|climbbybike|imdb|scotsman|thehindu|volcanodiscovery|emporis|sfgate|sciencedaily|advantour|reuters|lonelyplanet|bartleby|planetmountain|jpost|atlasobscura|visitvictoria|prensalibre|encyclopedia|ibtimes|vtourisme|economist|wondermondo|timesofisrael|showcaves|poluostrov-krym|hurriyetdailynews|guidetocaribbeanvacations|go2africa|foxnews|indonesia-tourism|petroleumnews|bahamas|bykasov|discogs|adn|eastjava|sacred-texts|bcferries|dtcuba|silkadv|freemaptools|flickr|capetownmagazine|cbsnews|irishtimes|sa-venues|latimes|livescience|nydailynews|cyclingweekly|visitusvi|vietnam-beauty|timesofmalta|space|newyorker|orexca|cell|theapricity|visitventspils|trout-salmon-fishing|smolyandnes|smithsonianmag|sites\.google|visittci|themarysue|viator|ultimatewyoming|thebritishjournal|sfakia-crete|thejakartapost|theborneopost|visitourchina|visitfinland|thepinaysolobackpacker|visitcyprus|tristandc|yamakei-online|wrangell|travelchannel|ynetnews|yardenit|tangkokowildlifetour|zainoo|topchinatravel|triposo|webkenya|texasmonthly|thaiwebsites|tangalooma|wdwinfo|standartnews|worldatlas|wolframalpha|welcomeargentina|webtenerife|waterfallsnorthwest|bangkokpost|sierrasun|scientificamerican|ukclimbing|visitnorway|turksandcaicostourism|travelchinaguide|la-razon|queenelizabethnationalpark|transylvaniabeyond|technologyreview|talamua|philstar|parovoz|tandfonline|thelancet)\.com/g, 'https://www.$1.com');
line = line.replace(/http\:\/\/www\.(cantickhead|bungeeamerica|bonjourquebec|billboard|chateauksara|bergsteigen|australiantraveller|archdaily|digitaltrends|clarin|contactmusic|climbing|alcatrazhistory|newscientist|nj|nationalparked|motorcycleclassics|messynessychic|reviewjournal|pobonline|mercurynews|haaretz|historyofinformation|greeka|frommers|foodandwine|ikion|kojaro|kohlarn|jweekly|jcs-group|im-mining|sellarondabikeday|libraryireland|madelineisland|laucala|mail-archive|malaysia-traveller|mayoalive|maritime-executive|ilovekohmak|india9|history|haramfjell|kashmirnewswatch|internationalstandardbible|khaleejtimes|greektouristguides|raremaps|rediff|red2000|railwaygazette|sbsun|scribd|roughguides|santiagoquintero|samoanews|rus-shipping|polb|newswise|nbcnews|n4gn|myweather2|nuttalls|nzbirds|photoukraine|outback-australia-travel-secrets|phnompenhpost|oxfordlearnersdictionaries|onestopmalaysia|oceanquestadventures|baltictimes|australianexplorer|beachbulgaria|arcticphoto|business-standard|bulgariaski|bookdepository|blackislebrewery|bintanlagoon|beyondships|bergnews|calexplornia|americaeconomia|alux|alshindagah|alpinforum|aljazeera|africangamesafari|africaguide|businessinsider|esri|explorecrete|elsnorkel|electricscotland|go-wisconsin|geolink-group|geody|fybush|freewebs|forestcamping|fodors|ekathimerini|czechtourism|cyclingnews|cruzanrum|cn-zhangjiajie|chokoloskee|chinahighlights|chateaumusar|darjeeling-tourism|ecologyasia|echinacities|dreamsunlimitedtravel|dnaindia|davidrumsey|dmcphoto|desertusa)\.com/g, 'https://www.$1.com');
} else if (TLD == '.ru') {
line = line.replace(/http\:\/\/www\.(100bestbooks|1tv|47news|alpfederation|alt\.kp|altairegion22|altertravel|ammonit|angi|archaeolog|arhpress|aroundspb|arsvest|astronews|atomic-energy|aviaport|bashinform|bellona|bestreferat|bn|bookol|booksite|calend|chinahighlights|chinatrips|city-n|citywalls|classes|domex|donland|dp|dprk|e-vid|e1|eao|ecosever|eltime|epochtimes|eprussia|eurosport|evolchel|fishnews|flytourist|fontanka|forbes|forum\.aroundspb|gardener|gazeta|gismeteo|golos-ameriki|greek|grekomania|grozny-inform|historicus|homesoverseas|ibiza|ikirov|ilovegreece|info83|infox|interfax-russia|interfax|iscmoscow|ivangorod|kateralodki|kavkaz-uzel|kleo|km|kommersant|korabel|kostyor|kp|krugosvet|ks87|ku66|ladatour\.spb|marshruty|mccme|meteovesti|mir-geo|mirkruizov|molodoi-gazeta|moya-planeta|murman|murmansk\.kp|nakanune|news29|newsvl|ng|ngpedia|nkj|nsktv|nsu|nta-nn|ntv|oblgazeta|oreanda|osd|oval|pnp|popmech|pravda|pravenc|prima-tv|privet-italia|prodam-ostrov|promved|prussia39|qrz|rfbr|rgo|ria|riatomsk|ridjey|ridus|rosbalt|rosmorport|rosreestr|rostmuseum|runivers|s-vfu|satcomservice|scienceforum|sea-law|sedmitza|skitalets|sobaka|spbmuseum|sport-express|studentlibrary|svirsky|tensy|the-village|timacad|timeout|topauthor|tv21|uchportfolio|uralweb|vedu|vesti|vestikavkaza|viktur|vitaly-company|vologda\.kp|votpusk|vprazdnik|vzsar|worldofnature|yuga|zel-veter|znanijamira|zrpress)\.ru/g, 'https://www.$1.ru');
} else if (TLD == '.org') {
line = line.replace(/http\:\/\/www\.(2mn|africanworldheritagesites|agu|alexanderyakovlev|alphagalileo|americanforests|azattyk|bsc-eoc|camptocamp|canids|cmas|cpawsyukon|culturalsurvival|dangerousroads|dbnl|democracynow|downtoearth-indonesia|ernc|euler-foundation|fauna-flora|fnpf|galapagos|geographic|globalsecurity|greenpeace|hikingincolorado|hikr|himalayanclub|historycooperative|historylink|hrnk|ilri|imf|inaturalist|indiansworld|interkriti|iucn|iucnredlist|lapl|mindat|monachus-guardian|nature|nepalmountaineering|newadvent|nwcouncil|nycgovparks|olympic|openstreetmap|panda|parksconservancy|pewtrusts|planetary|planinarskisavezrs|pnas|radiosvoboda|radomes|sciencemag|sdnhm|serafimovich|sfgov|sossi|spaceline|sprep|summitpost|travelfish|un|unep|unst|usdct|vqronline|wcs|wdl|wisconsinhistory|worldcat|worldstatesmen|worldwildlife|wsws|yadvashem)\.org/g, 'https://www.$1.org');
} else if (TLD == '.uk') {
line = line.replace(/http\:\/\/www\.(anglesey-history\.co|bbc\.co|britishempire\.co|clubmed\.co|colonsaybrewery\.co|dailymail\.co|dailyrecord\.co|discoverthefarneislands\.co|english-heritage\.org|exmoor-nationalpark\.gov|grough\.co|ibtimes\.co|ldwa\.org|legislation\.gov|loganair\.co|megalithic\.co|metoffice\.gov|mousa\.co|nhm\.ac|nlb\.org|ons\.gov|ourscotland\.co|peakdistrict\.gov|planningni\.gov|railscot\.co|scotlandscensus\.gov|scotlandschurchestrust\.org|sevensisters\.org|tate\.org|telegraph\.co|thebmc\.co|thesun\.co|thetimes\.co|ucl\.ac|visionofbritain\.org|wcmc\.org|wildlifeindia\.co)\.uk/g, 'https://www.$1.uk');
} else if (TLD == '.au') {
line = line.replace(/http\:\/\/www\.(abc\.net|abs\.gov|austehc\.unimelb\.edu|censusdata\.abs\.gov|dalmura\.com|earth2006\.org|easyweddings\.com|environment\.nsw\.gov|legislation\.qld\.gov|nationalparks\.nsw\.gov|news\.uwa\.edu|parks\.tas\.gov|parksaustralia\.gov|publish\.csiro|slsa\.sa\.gov|smh\.com|stbarbara\.com|theage\.com|thelist\.tas\.gov|utas\.edu|watoday\.com|wellingtonpark\.org)\.au/g, 'https://www.$1.au');
} else if (TLD == '.net') {
line = line.replace(/http\:\/\/www\.(adv-geosci|americansouthwest|bigwalls|chamonix|faz|hydrol-earth-syst-sci|letsgosago|locman|losangelesnews|maldivestourism|mendikat|protectedplanet|remontees-mecaniques|sabanews|santorini|satelliteviews|scotchwhisky|solomonencyclopaedia|telesurtv|valaam|vettorg|walkopedia)\.net/g, 'https://www.$1.net');
} else if (TLD == '.de') {
line = line.replace(/http\:\/\/www\.(bfn|biosphaerenreservat-oberlausitz|chiemsee-inseln|dhm|eva\.mpg|evolution-mensch|freiepresse|herrenchiemsee|jv-karlsruhe|landesarchiv-bw|landkartenarchiv|mz-web|nationalpark-harz|skiinfo|spiegel|sueddeutsche|tim-online\.nrw|volksliederarchiv|wiesbaden|wlb-stuttgart)\.de/g, 'https://www.$1.de');
} else if (TLD == '.ch') {
line = line.replace(/http\:\/\/www\.(bagnes|bls|e-rara|eigernorthface|gipfelbuch|hoherkasten|kora|montelema|nidlenloch|nzz|saas-fee|sust\.admin|swisseduc|swissinfo|tagesanzeiger|trail|zermatt)\.ch/g, 'https://www.$1.ch');
} else if (TLD == '.gr') {
line = line.replace(/http\:\/\/www\.(capital|clickatlife|greeknewsagenda|gtp|karpenissi|kosisland|kythnos|matia|rhodes|rodiaki|sportsmag|statistics|tanea|tovima)\.gr/g, 'https://www.$1.gr');
} else if (TLD == '.fr') {
line = line.replace(/http\:\/\/www\.(amisdesaintevictoire\.asso|iledaix|infoclimat|insee|larepubliquedespyrenees|larousse|lefigaro|legifrance\.gouv|mpl\.ird|persee|rfi|rtl|taaf)\.fr/g, 'https://www.$1.fr');
} else if (TLD == '.gov') {
line = line.replace(/http\:\/\/www\.(faa|fs\.usda|fws|gao|jpl\.nasa|loc|ncdc\.noaa|ncparks|nps|npwrc\.usgs|nsf|osti|recreation)\.gov/g, 'https://www.$1.gov');
} else if (TLD == '.it') {
line = line.replace(/http\:\/\/www\.(alicudihotel|bikelabvideo|gazzetta|giornaletrentino|guidasicilia|lastampa|lescienze|limosa|lovevda|monasterodibose|nigrizia|repubblica)\.it/g, 'https://www.$1.it');
} else if (TLD == '.ca') {
line = line.replace(/http\:\/\/www\.(aadnc-aandc\.gc|bible|cbc|chrs|electionsquebec\.qc|globalresearch|historicplaces|naturecanada|pc\.gc|statcan|unb)\.ca/g, 'https://www.$1.ca');
} else if (TLD == '.info') {
line = line.replace(/http\:\/\/www\.(activestudy|anapa|apsnypress|franz-josef-land|lordhoweisland|scottish-places|sibir|slovenia|sthelenaisland|wandernsuedtirol)\.info/g, 'https://www.$1.info');
} else if (TLD == '.ee') {
line = line.replace(/http\:\/\/www\.(hiiumaa|kalapeedia|keskkonnaamet|loodusajakiri|noavv|rmk|stat|suurmunamagi|tallinn|valitsus)\.ee/g, 'https://www.$1.ee');
} else if (TLD == '.nz') {
line = line.replace(/http\:\/\/www\.(doc\.govt|gsnz\.org|landcareresearch\.co|linz\.govt|maritimenz\.govt|nzherald\.co|scoop\.co|stats\.govt|teara\.govt)\.nz/g, 'https://www.$1.nz');
} else if (TLD == '.jp') {
line = line.replace(/http\:\/\/www\.(e-stat\.go|gsi\.go|japantimes\.co|jpp\.co|mlit\.go|mofa\.go|nta\.go|rinya\.maff\.go|takaosan\.or)\.jp/g, 'https://www.$1.jp');
} else if (TLD == '.edu') {
line = line.replace(/http\:\/\/www\.(academia|journals\.uchicago|lgs\.lsu|lib\.utexas|mona\.uwi|presidency\.ucsb|tamu|uaf)\.edu/g, 'https://www.$1.edu');
} else if (TLD == '.fi') {
line = line.replace(/http\:\/\/www\.(doria|environment|geologinenseura|metsa|nationalparks|ruka|ymparisto)\.fi/g, 'https://www.$1.fi');
} else if (TLD == '.eu') {
line = line.replace(/http\:\/\/www\.(aemnp|europarl\.europa|europeanjournaloftaxonomy|kavkaz-uzel|parkrilski-manastir|postojnska-jama)\.eu/g, 'https://www.$1.eu');
} else if (TLD == '.es') {
line = line.replace(/http\:\/\/www\.(abc|barrancodelinfierno|canarias7|diariodeibiza|laverdad)\.es/g, 'https://www.$1.es');
} else if (TLD == '.by') {
line = line.replace(/http\:\/\/www\.(belarus|belstat\.gov|belta|bible|minpriroda\.gov)\.by/g, 'https://www.$1.by');
} else if (TLD == '.ar') {
line = line.replace(/http\:\/\/www\.(cienciahoy\.org|ign\.gob|lanacion\.com|lavoz\.com|peapaleontologica\.org)\.ar/g, 'https://www.$1.ar');
} else if (TLD == '.il') {
line = line.replace(/http\:\/\/www\.(deshe\.org|newsru\.co|parks\.org|tau\.ac|wzo\.org)\.il/g, 'https://www.$1.il');
} else if (TLD == '.hr') {
line = line.replace(/http\:\/\/www\.(dzs|enciklopedija|hr|vecernji)\.hr/g, 'https://www.$1.hr');
} else if (TLD == '.cl') {
line = line.replace(/http\:\/\/www\.(conaf|elmostrador|estrellaiquique|gochile)\.cl/g, 'https://www.$1.cl');
} else if (TLD == '.ie') {
line = line.replace(/http\:\/\/www\.(gsi|independent|met|rte)\.ie/g, 'https://www.$1.ie');
} else if (TLD == '.is') {
line = line.replace(/http\:\/\/www\.(akureyri|icenews|isor|mbl)\.is/g, 'https://www.$1.is');
} else if (TLD == '.int') {
line = line.replace(/http\:\/\/www\.(cbd|spc|wcpfc|who)\.int/g, 'https://www.$1.int');
} else if (TLD == '.ua') {
line = line.replace(/http\:\/\/www\.(discoverukraine\.com|kp|phototravel\.dp|umoloda\.kiev)\.ua/g, 'https://www.$1.ua');
} else if (TLD == '.be') {
line = line.replace(/http\:\/\/www\.(dekamer|hln|lalibre)\.be/g, 'https://www.$1.be');
} else if (TLD == '.br') {
line = line.replace(/http\:\/\/www\.(ibge\.gov|oeco\.org|scielo)\.br/g, 'https://www.$1.br');
} else if (TLD == '.travel') {
line = line.replace(/http\:\/\/www\.(samoa|serbia|seychelles)\.travel/g, 'https://www.$1.travel');
} else if (TLD == '.pl') {
line = line.replace(/http\:\/\/www\.(kampinoski-pn\.gov|nid|smz\.waw)\.pl/g, 'https://www.$1.pl');
} else if (TLD == '.lv') {
line = line.replace(/http\:\/\/www\.(daba\.gov|varam\.gov)\.lv/g, 'https://www.$1.lv');
} else if (TLD == '.bo') {
line = line.replace(/http\:\/\/www\.(ine\.gob|opinion\.com)\.bo/g, 'https://www.$1.bo');
} else if (TLD == '.sk') {
line = line.replace(/http\:\/\/www\.(bratislavskenoviny|infoglobe)\.sk/g, 'https://www.$1.sk');
} else if (TLD == '.mx') {
line = line.replace(/http\:\/\/www\.(eluniversal\.com|jornada\.unam)\.mx/g, 'https://www.$1.mx');
} else if (TLD == '.ir') {
line = line.replace(/http\:\/\/www\.(hamshahrionline|sid)\.ir/g, 'https://www.$1.ir');
} else if (TLD == '.no') {
line = line.replace(/http\:\/\/www\.(ssb|yr)\.no/g, 'https://www.$1.no');
} else if (TLD == '.nl') {
line = line.replace(/http\:\/\/www\.(natuurmonumenten|vocsite)\.nl/g, 'https://www.$1.nl');
} else if (TLD == '.kz') {
line = line.replace(/http\:\/\/www\.(inform|zakon)\.kz/g, 'https://www.$1.kz');
} else if (TLD == '.ec') {
line = line.replace(/http\:\/\/www\.(ambiente\.gob)\.ec/g, 'https://www.$1.ec');
} else if (TLD == '.ge') {
line = line.replace(/http\:\/\/www\.(apsny)\.ge/g, 'https://www.$1.ge');
} else if (TLD == '.am') {
line = line.replace(/http\:\/\/www\.(armstat)\.am/g, 'https://www.$1.am');
} else if (TLD == '.aq') {
line = line.replace(/http\:\/\/www\.(ats)\.aq/g, 'https://www.$1.aq');
} else if (TLD == '.co') {
line = line.replace(/http\:\/\/www\.(banrep\.gov)\.co/g, 'https://www.$1.co');
} else if (TLD == '.md') {
line = line.replace(/http\:\/\/www\.(canal3)\.md/g, 'https://www.$1.md');
} else if (TLD == '.in') {
line = line.replace(/http\:\/\/www\.(corbettnationalpark)\.in/g, 'https://www.$1.in');
} else if (TLD == '.pe') {
line = line.replace(/http\:\/\/www\.(ferrocarrilcentral\.com)\.pe/g, 'https://www.$1.pe');
} else if (TLD == '.us') {
line = line.replace(/http\:\/\/www\.(fs\.fed)\.us/g, 'https://www.$1.us');
} else if (TLD == '.tr') {
line = line.replace(/http\:\/\/www\.(hurriyet\.com)\.tr/g, 'https://www.$1.tr');
} else if (TLD == '.pt') {
line = line.replace(/http\:\/\/www\.(ine)\.pt/g, 'https://www.$1.pt');
} else if (TLD == '.la') {
line = line.replace(/http\:\/\/www\.(lausitz)\.la/g, 'https://www.$1.la');
} else if (TLD == '.mt') {
line = line.replace(/http\:\/\/www\.(miym\.com)\.mt/g, 'https://www.$1.mt');
} else if (TLD == '.cy') {
line = line.replace(/http\:\/\/www\.(mof\.gov)\.cy/g, 'https://www.$1.cy');
} else if (TLD == '.se') {
line = line.replace(/http\:\/\/www\.(ne)\.se/g, 'https://www.$1.se');
} else if (TLD == '.rs') {
line = line.replace(/http\:\/\/www\.(novosti)\.rs/g, 'https://www.$1.rs');
} else if (TLD == '.lt') {
line = line.replace(/http\:\/\/www\.(obzor)\.lt/g, 'https://www.$1.lt');
} else if (TLD == '.id') {
line = line.replace(/http\:\/\/www\.(pa-bawean\.go)\.id/g, 'https://www.$1.id');
} else if (TLD == '.ba') {
line = line.replace(/http\:\/\/www\.(rtvtk)\.ba/g, 'https://www.$1.ba');
} else if (TLD == '.me') {
line = line.replace(/http\:\/\/www\.(rulit)\.me/g, 'https://www.$1.me');
} else if (TLD == '.sh') {
line = line.replace(/http\:\/\/www\.(sainthelena\.gov)\.sh/g, 'https://www.$1.sh');
} else if (TLD == '.ro') {
line = line.replace(/http\:\/\/www\.(speotravaux\.iser)\.ro/g, 'https://www.$1.ro');
} else if (TLD == '.dk') {
line = line.replace(/http\:\/\/www\.(statistikbanken)\.dk/g, 'https://www.$1.dk');
} else if (TLD == '.bg') {
line = line.replace(/http\:\/\/www\.(strandja)\.bg/g, 'https://www.$1.bg');
} else if (TLD == '.ae') {
line = line.replace(/http\:\/\/www\.(thenational)\.ae/g, 'https://www.$1.ae');
} else if (TLD == '.pk') {
line = line.replace(/http\:\/\/www\.(thenews\.com)\.pk/g, 'https://www.$1.pk');
} else if (TLD == '.my') {
line = line.replace(/http\:\/\/www\.(thestar\.com)\.my/g, 'https://www.$1.my');
} else if (TLD == '.az') {
line = line.replace(/http\:\/\/www\.(tourism)\.az/g, 'https://www.$1.az');
} else if (TLD == '.at') {
line = line.replace(/http\:\/\/www\.(verwaltung\.steiermark)\.at/g, 'https://www.$1.at');
} else if (TLD == '.sb') {
line = line.replace(/http\:\/\/www\.(visitsolomons\.com)\.sb/g, 'https://www.$1.sb');
} else if (TLD == '.uy') {
line = line.replace(/http\:\/\/www\.(wrm\.org)\.uy/g, 'https://www.$1.uy');
}
}
else
{
if (TLD == '.ru') {
line = line.replace(/http\:\/\/(lenta|ria|tass|elementy|cyberleninka|dic\.academic|bigenc|rg|ogv\.karelia|vz|nature\.baikal|hab\.mk|webmineral|pescheri-mira|uraloved|regnum|inosmi|prirodasibiri|news\.ngs|thelib|penza-flora\.okis|img-fotki\.yandex|gazetazp|kamskoye-ustye\.tatarstan|earth-chronicles|nat-geo|expert|guide-israel|zaimka|terijoki\.spb|svpressa|treeportal|tvkultura|stav\.aif|youroute|ysia|sobory|altapress|sputnik-abkhazia|statehistory|nedradv|urban3p|arhangelsk\.allnw|mid|vladnews|alpfederation|iscmoscow|leopard-land|primamedia|big-archive|fotki\.yandex|ahtanizsp|gazeta|ngs24|nversia|nvo\.ng|tourweek|moluch|hebrew-studies\.philosophy\.spbu|lib\.rgo|portal-kultura|pandia|kavkaz\.mk|angi|zakon-region2|msu\.lenobl|kirov\.rgo|mountain\.nsu|minstroy\.samregion|moi-portal|culttourism|dagestan\.rgo|agesmystery|161|geography-a|zuratkul|22century|runivers|lenobl|tinaocenter|park-beringia|yambe|parktarhankut|bogoslov|nord-news|routes\.votpusk|skitalets|rustelegraph|rscf|risk|spb\.mk|rgavmf|radioblago|old\.rgo|smolensk\.rgo|vlg-media|stomestrf|valaam|turizm\.ngs|tlt|niidokuchaeva|netref|nazaccent|nature\.1001chudo|nat\.astrobl|naked-science|pattayatrip|pln-pskov|peterhofmuseum)\.ru/g, 'https://$1.ru');
line = line.replace(/http\:\/\/(pesh-com|orenzap|otherreferats\.allbest|otdih\.nakubani|orthomission|nado\.znate|pravchelny|lib\.znate|lawrussia|lakebaikal|marmam|my\.mail|murmansk\.allnw|mstrok|moxnpn|mos-holidays|posibiri|tizdar|theatremuseum|textarchive|tourism\.interfax|survinat|subscribe|static\.diary|states-of-america|spbdnevnik|u7a|twentysix|tvzvezda|turbina|travellanka|travelask|sport-marafon|rutraveller|rus-shipping|rk\.gov|rezanov\.krasu|rest61|region33\.ucoz|raenza|priroda36|samara\.aif|socotra|sochi-24|skachate|sibkray|shkolazhizni|scientificrussia|save-shihan|kudarf|ulin|brasil-russia|bozem\.ucoz|birds\.sfu-kras|bellona|crimea_toponyms\.academic|culturavrn|crimea\.mk|chelindustry|club\.wcb|club\.foto|citysakh|china-sky|belhist|allingvo|aksay-museum|aif|amur-bereg|7vershin|7dach|73online|1ul|azbyka|atv\.ucoz|arhpress|argumenti|krymania|ib\.komisc|huntmap|gubernia74|govoritmoskva|jeduvkrym|krasnoe\.ucoz|kipros|kandalaksha-reserve|irkobl|influenza\.spb|geo\.koltyrin|gazetadaily|echo\.msk|drugoigorod|elar\.usfeu|dog\.my1|dni|function\.mil|foto-traveller|flnka|fantlab|uzb\.ucoz|vlad\.aif|vkds|vestiprim|w\.histrf|vcvetu|valentin-nuzhdenko|v102|vlad\.mk|water-rf|worldconstitutions)\.ru/g, 'https://$1.ru');
} else if (TLD == '.com') {
line = line.replace(/http\:\/\/(peakbagger|jalita|flot|romveres\.livejournal|ru\.euronews|centralsib|distancecalculator\.globefeed|gulfnews|travel\.nytimes|velolive|explorekohchang|krasnews|latimesblogs\.latimes|maxpark|edition\.cnn|kerchinfo|hubpages|ibc\.lynxeds|info-rm|instaar\.metapress|io9\.gizmodo|navajotours|yuri-maksimov\.livejournal|korpensoga|law\.justia|marinas|moon|grancanaria|adelecosgrovebray\.hubpages|b-port|explorebyyourself|es\.scribd|emedicine\.medscape|hotelsbroker|news\.mongabay|imdb|mediaindonesia|rmbooks|max425\.wordpress|raregoldnuggets|velib|news\.sky|ny\.curbed|novostipmr|nypost|oreivatein|poluostrov-krym|parovoz|paanajarvi-park|outoftownblog|marinatravelblog|matseevski\.livejournal|mybigfatgreekmarriageru\.wordpress|mosoblles|megamashina\.livejournal|mir-znaniy|mignews|mevamevo\.livejournal|kubantur|tastracks\.webs|timesofindia\.indiatimes|thetravelteller|tourism\.webindia123|ucmopuockon\.livejournal|travel\.kompas|ru-royalty\.livejournal)\.com/g, 'https://$1.com');
line = line.replace(/http\:\/\/(ruslapland\.livejournal|ru\.reuters|safari-tour|saariselka|sorrentocoastlimo|silkadv|ski\.lovetoknow|sites\.google|semyaigorod\.livejournal|krymoteka|centralasia-adventures|blogs\.chicagotribune|bivouac|certs-it|cvarnou\.livejournal|cs\.cruise|crimeanblog\.blogspot|creation|correodelsur|abhoc|alaskatours|akfireinfo|abcnews\.go|3planeta|ancientimes\.blogspot|barentsobserver|baikal-extreme|auto-dnevnik|austhrutime|ant-ufa|artdaily|archipelagofastfact\.wordpress|antinormanist\.livejournal|i-gazeta|hn\.qq|ierapetramyguide\.wordpress|gromovdv\.livejournal|geoknigi|idahosummits|igor-solomadin\.livejournal|jpninfo|journalmetro|ivitas\.livejournal|indianexpress|in\.reuters|dutcheastindies\.webs|economictimes\.indiatimes|e-polonskiy\.livejournal|dotearth\.blogs\.nytimes|dm-fedorov\.livejournal|egyptianstreets|fromheretonowhere|freedivenusa|europeforvisitors|euro-map|etio\.webs|ermakvagus|uk\.reuters|vizaviz\.livejournal|viktorkotl\.livejournal|vancouversun|valday|vahemart\.livejournal|wuvulu|wattsupwiththat)\.com/g, 'https://$1.com');
} else if (TLD == '.org') {
line = line.replace(/http\:\/\/(2mn|aapgbull\.geoscienceworld|advances\.sciencemag|assets\.panda|babel\.hathitrust|bib\.convdocs|caves|cdsg|custance|de\.wikinews|dx\.doi|econgeol\.geoscienceworld|en\.wikisource|eol|esa\.un|geographic|geology\.geoscienceworld|geosfera|gt27|historylib|insideclimatenews|journals\.cambridge|journals\.plos|madelineislandmuseum\.wisconsinhistory|newzealandecology|pib\.socioambiental|redbook-ua|ru\.wadiocese|ru\.wikinews|rus\.ozodi|soysambuconservancy|sp\.lyellcollection|ugsra|unispal\.un|unstats\.un)\.org/g, 'https://$1.org');
} else if (TLD == '.net') {
line = line.replace(/http\:\/\/(anthropology|article\.tebyan|asiamountains|aviation-safety|biz\.liga|booksandideas|eco-turizm|enc\.daum|histdoc|iknigi|korrespondent|lifeglobe|mirchudes|modernlib|navoprosotveta|news\.allcrimea|news\.liga|protectedplanet|short-toed-eagle|strogi|tak-to-ent|tourlib|trvlworld|visitcentralbalkan)\.net/g, 'https://$1.net');
} else if (TLD == '.gov') {
line = line.replace(/http\:\/\/(antwrp\.gsfc\.nasa|ca\.water\.usgs|cfpub\.epa|dec\.alaska|dnr\.wi|earthobservatory\.nasa|eclipse\.gsfc\.nasa|egsc\.usgs|erg\.usgs|focus\.nps|geopubs\.wr\.usgs|neo\.sci\.gsfc\.nasa|npgallery\.nps|oceanexplorer\.noaa|photojournal\.jpl\.nasa|planetarynames\.wr\.usgs|pubs\.usgs|tpwd\.texas|volcanoes\.usgs|vulcan\.wr\.usgs|water\.usgs|www2\.jpl\.nasa)\.gov/g, 'https://$1.gov');
} else if (TLD == '.ua') {
line = line.replace(/http\:\/\/(4sport|7chudes\.in|chtyvo\.org|cml\.happy\.kiev|collectedpapers\.com|dp\.kp|gazetaslovo\.at|interfax\.com|karpaty\.nezabarom|kga\.gov|kp|leninskoe-zp\.io|necu\.org|plants-club|slk\.kh|sud|texty\.org|zakon\.rada\.gov)\.ua/g, 'https://$1.ua');
} else if (TLD == '.edu') {
line = line.replace(/http\:\/\/(anthropology\.colostate|avo\.alaska|collections\.dartmouth|digitalassets\.lib\.berkeley|elibrary\.unm|faculty\.georgetown|library\.puc|libweb5\.princeton|matsu\.alaska|muse\.jhu|pirlwww\.lpl\.arizona|santacruz\.nrs\.ucsb|scholarspace\.manoa\.hawaii|unu|volcano\.si|wwi\.lib\.byu)\.edu/g, 'https://$1.edu');
} else if (TLD == '.kz') {
line = line.replace(/http\:\/\/(24|365info|crimea|e-history|kapital|library\.psu|mk-kz|otyrar|ruh)\.kz/g, 'https://$1.kz');
} else if (TLD == '.au') {
line = line.replace(/http\:\/\/(allsaints-southhobart\.org|cs\.nga\.gov|data\.aad\.gov|ebooks\.adelaide\.edu|eprints\.utas\.edu|helictite\.caves\.org|maps\.land\.vic\.gov|parks\.dpaw\.wa\.gov)\.au/g, 'https://$1.au');
} else if (TLD == '.info') {
line = line.replace(/http\:\/\/(allcastle|gis-lab|iahs|mtmawson|sakhalin|satmaps|uralsky|xakac)\.info/g, 'https://$1.info');
} else if (TLD == '.uk') {
line = line.replace(/http\:\/\/(arts\.guardian\.co|biblicalarchaeology\.org|cairngorms\.co|digital\.nls|herbaria\.plants\.ox\.ac|maps\.google\.co)\.uk/g, 'https://$1.uk');
} else if (TLD == '.su') {
line = line.replace(/http\:\/\/(ecoportal|encsakhalin|mold|skr|vkrym)\.su/g, 'https://$1.su');
} else if (TLD == '.pl') {
line = line.replace(/http\:\/\/(bpn\.com|krakow\.wyborcza|mapy\.geoportal\.gov|tpkgdansk|wyborcza)\.pl/g, 'https://$1.pl');
} else if (TLD == '.vn') {
line = line.replace(/http\:\/\/(dantri\.com|tuoitrenews|vietbao|vietnam\.vnanet|vietnamnews)\.vn/g, 'https://$1.vn');
} else if (TLD == '.jp') {
line = line.replace(/http\:\/\/(cais\.gsi\.go|dictionary\.goo\.ne|mainichi|news\.tv-asahi\.co)\.jp/g, 'https://$1.jp');
} else if (TLD == '.fr') {
line = line.replace(/http\:\/\/(gallica\.bnf|museefabre\.montpellier3m|tel\.archives-ouvertes|tipaza\.typepad)\.fr/g, 'https://$1.fr');
} else if (TLD == '.ch') {
line = line.replace(/http\:\/\/(biblio\.unibe|hls-dhs-dss|map\.geo\.admin|nashagazeta)\.ch/g, 'https://$1.ch');
} else if (TLD == '.az') {
line = line.replace(/http\:\/\/(1news|modern|silent|zerkalo)\.az/g, 'https://$1.az');
} else if (TLD == '.by') {
line = line.replace(/http\:\/\/(grodnonews|libr\.msu|orda\.of|pravo)\.by/g, 'https://$1.by');
} else if (TLD == '.gr') {
line = line.replace(/http\:\/\/(antiparos|biodiversitysitia|buk)\.gr/g, 'https://$1.gr');
} else if (TLD == '.hr') {
line = line.replace(/http\:\/\/(dnevnik|hrcak\.srce|zadarski\.slobodnadalmacija)\.hr/g, 'https://$1.hr');
} else if (TLD == '.cz') {
line = line.replace(/http\:\/\/(jihlava\.idnes|mapy\.mzk|zpravy\.idnes)\.cz/g, 'https://$1.cz');
} else if (TLD == '.ee') {
line = line.replace(/http\:\/\/(maaleht\.delfi|rus\.err|rus\.postimees)\.ee/g, 'https://$1.ee');
} else if (TLD == '.eu') {
line = line.replace(/http\:\/\/(cordis\.europa|eunis\.eea\.europa|natura2000\.eea\.europa)\.eu/g, 'https://$1.eu');
} else if (TLD == '.it') {
line = line.replace(/http\:\/\/(digilander\.libero|palermo\.repubblica|trentofestival)\.it/g, 'https://$1.it');
} else if (TLD == '.il') {
line = line.replace(/http\:\/\/(flora\.org|news\.walla\.co|parks\.org)\.il/g, 'https://$1.il');
} else if (TLD == '.id') {
line = line.replace(/http\:\/\/(bem\.feb\.ugm\.ac|ntt\.bps\.go|sp2010\.bps\.go)\.id/g, 'https://$1.id');
} else if (TLD == '.ca') {
line = line.replace(/http\:\/\/(circle\.ubc|epe\.lac-bac\.gc|www12\.statcan\.gc)\.ca/g, 'https://$1.ca');
} else if (TLD == '.es') {
line = line.replace(/http\:\/\/(dialnet\.unirioja|sobreturismo)\.es/g, 'https://$1.es');
} else if (TLD == '.bg') {
line = line.replace(/http\:\/\/(bnr|dnes\.dir)\.bg/g, 'https://$1.bg');
} else if (TLD == '.us') {
line = line.replace(/http\:\/\/(assumption|dnr\.state\.md)\.us/g, 'https://$1.us');
} else if (TLD == '.is') {
line = line.replace(/http\:\/\/(en\.vedur|hagstofa)\.is/g, 'https://$1.is');
} else if (TLD == '.lv') {
line = line.replace(/http\:\/\/(m\.delfi|rus\.delfi)\.lv/g, 'https://$1.lv');
} else if (TLD == '.nl') {
line = line.replace(/http\:\/\/(nos|wetten\.overheid)\.nl/g, 'https://$1.nl');
} else if (TLD == '.fm') {
line = line.replace(/http\:\/\/(sib|tomsk)\.fm/g, 'https://$1.fm');
} else if (TLD == '.nz') {
line = line.replace(/http\:\/\/(paperspast\.natlib\.govt|teara\.govt)\.nz/g, 'https://$1.nz');
} else if (TLD == '.de') {
line = line.replace(/http\:\/\/(epic\.awi|www1\.nls\.niedersachsen)\.de/g, 'https://$1.de');
} else if (TLD == '.dk') {
line = line.replace(/http\:\/\/(statistikbanken|www2\.dmu)\.dk/g, 'https://$1.dk');
} else if (TLD == '.fi') {
line = line.replace(/http\:\/\/(retkipaikka|yle)\.fi/g, 'https://$1.fi');
} else if (TLD == '.travel') {
line = line.replace(/http\:\/\/(azerbaijan)\.travel/g, 'https://$1.travel');
} else if (TLD == '.lt') {
line = line.replace(/http\:\/\/(bustas\.lrytas)\.lt/g, 'https://$1.lt');
} else if (TLD == '.cat') {
line = line.replace(/http\:\/\/(cabrera\.dbalears)\.cat/g, 'https://$1.cat');
} else if (TLD == '.md') {
line = line.replace(/http\:\/\/(ecology)\.md/g, 'https://$1.md');
} else if (TLD == '.tv') {
line = line.replace(/http\:\/\/(espreso)\.tv/g, 'https://$1.tv');
} else if (TLD == '.hu') {
line = line.replace(/http\:\/\/(index)\.hu/g, 'https://$1.hu');
} else if (TLD == '.tr') {
line = line.replace(/http\:\/\/(journals\.tubitak\.gov)\.tr/g, 'https://$1.tr');
} else if (TLD == '.ie') {
line = line.replace(/http\:\/\/(mountainviews)\.ie/g, 'https://$1.ie');
} else if (TLD == '.ro') {
line = line.replace(/http\:\/\/(pcrai)\.ro/g, 'https://$1.ro');
} else if (TLD == '.me') {
line = line.replace(/http\:\/\/(petlike)\.me/g, 'https://$1.me');
} else if (TLD == '.am') {
line = line.replace(/http\:\/\/(photoclub\.do)\.am/g, 'https://$1.am');
} else if (TLD == '.land') {
line = line.replace(/http\:\/\/(prim)\.land/g, 'https://$1.land');
} else if (TLD == '.za') {
line = line.replace(/http\:\/\/(repository\.up\.ac)\.za/g, 'https://$1.za');
} else if (TLD == '.br') {
line = line.replace(/http\:\/\/(saladeimprensa\.ibge\.gov)\.br/g, 'https://$1.br');
} else if (TLD == '.ir') {
line = line.replace(/http\:\/\/(seeiran)\.ir/g, 'https://$1.ir');
} else if (TLD == '.no') {
line = line.replace(/http\:\/\/(ssb)\.no/g, 'https://$1.no');
} else if (TLD == '.today') {
line = line.replace(/http\:\/\/(tv2)\.today/g, 'https://$1.today');
} else if (TLD == '.mk') {
line = line.replace(/http\:\/\/(tvm)\.mk/g, 'https://$1.mk');
} else if (TLD == '.ae') {
line = line.replace(/http\:\/\/(visitabudhabi)\.ae/g, 'https://$1.ae');
} else if (TLD == '.xn--p1ai') {
line = line.replace(/http\:\/\/(xn--d1ahaoghbejbc5k)\.xn--p1ai/g, 'https://$1.xn--p1ai');
}
}
return line;
});
 
r(/https?\:\/\/(www\.[^\/ \]\n\|\}]+)/g, function ( line, domain ) {//устаревшие www
var TLD = domain.match(/(\.[^\.]+?$)/g);
 
if (TLD == '.ru') {
line = line.replace(/\:\/\/www\.(3dnews|aif|altai\.aif|archaeology\.nsc|astronomy|bibliopskov|biodat|catalogmineralov|council\.gov|crimea|cultinfo|dagzapoved|destinations|dni|dommuseum|echo\.msk|ecosystema|flnka|gornovosti|goural|gramota|gudok|ipae\.uran|irk\.aif|kmvline|kp74|kulturologia|lenta|lesder|mkset|moluch|moya-planeta|my\.arcto|nat-geo|nbdrx|newdaynews|novayagazeta|npsamluka|online812|ortho-rus|otr-online|prayslain|proza|regions|regnum|rg|risk|rostov\.aif|rusk|rutraveller|rvb|sanmashuk|scienceforum|spb\.aif|testpilot|towiki|travelstar|tumentoday|utro|valaam|vdmst|vetert|vistgroup|vz|westra|wwf|zoodrug)\.ru/g, '://$1.ru');
} else if (TLD == '.com') {
line = line.replace(/\:\/\/www\.(abhoc|alexclimb|amerisurv|ancientpages|apnews|b-port|britishcolumbia|cuencahighlife|designiscentral|discover-bulgaria|dprktoday|elpensante|galapagosalternative|igoterra|israeltripplanner|journeysbydesign|mediaindonesia|mignews|nauka-shop|newzealandlighthouses|oreivatein|pacificwrecks|piknicelectronik|rumtherapy|seasancarlos|soundsandcolours|southaustralia|studyspanish|sudantribune|thehimalayantimes|timesofmalta|tocrete|tourist-area|ukrreferat|utalii|versii|volcanolive|vostokmedia|wuvulu|wysotsky|zapovedniki-mira)\.com/g, '://$1.com');
} else if (TLD == '.org') {
line = line.replace(/\:\/\/www\.(answersingenesis|archive|biblearchaeology|bioone|caves|discoverytrail|dzanga-sangha|ekodosd|gsajournals|hawaiiatolls|iccrimea|iranicaonline|isogg|karstwaters|newzealandecology)\.org/g, '://$1.org');
} else if (TLD == '.ua') {
line = line.replace(/\:\/\/www\.(city\.kharkov|kreschatic\.kiev|nashkray\.kiev|zabor\.zp)\.ua/g, '://$1.ua');
} else if (TLD == '.net') {
line = line.replace(/\:\/\/www\.(gazeta\.rjews|histdoc|lawphil)\.net/g, '://$1.net');
} else if (TLD == '.edu') {
line = line.replace(/\:\/\/www\.(avo\.alaska|lib\.byu|volcano\.si)\.edu/g, '://$1.edu');
} else if (TLD == '.uk') {
line = line.replace(/\:\/\/www\.(car-hire-centre\.co|jncc\.gov)\.uk/g, '://$1.uk');
} else if (TLD == '.nl') {
line = line.replace(/\:\/\/www\.(repository\.naturalis|waddenzee)\.nl/g, '://$1.nl');
} else if (TLD == '.vn') {
line = line.replace(/\:\/\/www\.(phongnhakebang|saigon-gpdaily\.com)\.vn/g, '://$1.vn');
} else if (TLD == '.info') {
line = line.replace(/\:\/\/www\.(sakhalin|shamora)\.info/g, '://$1.info');
} else if (TLD == '.de') {
line = line.replace(/\:\/\/www\.(taz|themenpark-umwelt\.baden-wuerttemberg)\.de/g, '://$1.de');
} else if (TLD == '.az') {
line = line.replace(/\:\/\/www\.(1news)\.az/g, '://$1.az');
} else if (TLD == '.nu') {
line = line.replace(/\:\/\/www\.(bornholm)\.nu/g, '://$1.nu');
} else if (TLD == '.kz') {
line = line.replace(/\:\/\/www\.(bourabai)\.kz/g, '://$1.kz');
} else if (TLD == '.it') {
line = line.replace(/\:\/\/www\.(centrostudinatura)\.it/g, '://$1.it');
} else if (TLD == '.us') {
line = line.replace(/\:\/\/www\.(commerce\.state\.ak)\.us/g, '://$1.us');
} else if (TLD == '.eu') {
line = line.replace(/\:\/\/www\.(echodnia)\.eu/g, '://$1.eu');
} else if (TLD == '.si') {
line = line.replace(/\:\/\/www\.(enavtika)\.si/g, '://$1.si');
} else if (TLD == '.no') {
line = line.replace(/\:\/\/www\.(fyr)\.no/g, '://$1.no');
} else if (TLD == '.ch') {
line = line.replace(/\:\/\/www\.(hls-dhs-dss)\.ch/g, '://$1.ch');
} else if (TLD == '.ca') {
line = line.replace(/\:\/\/www\.(horizonweekly)\.ca/g, '://$1.ca');
} else if (TLD == '.int') {
line = line.replace(/\:\/\/www\.(iho)\.int/g, '://$1.int');
} else if (TLD == '.by') {
line = line.replace(/\:\/\/www\.(interfax)\.by/g, '://$1.by');
} else if (TLD == '.cc') {
line = line.replace(/\:\/\/www\.(kilimanjaro)\.cc/g, '://$1.cc');
} else if (TLD == '.fi') {
line = line.replace(/\:\/\/www\.(po-russki\.nationalparks)\.fi/g, '://$1.fi');
} else if (TLD == '.pt') {
line = line.replace(/\:\/\/www\.(portugalvirtual)\.pt/g, '://$1.pt');
} else if (TLD == '.su') {
line = line.replace(/\:\/\/www\.(priroda)\.su/g, '://$1.su');
} else if (TLD == '.nz') {
line = line.replace(/\:\/\/www\.(royalsociety\.org)\.nz/g, '://$1.nz');
} else if (TLD == '.ee') {
line = line.replace(/\:\/\/www\.(ruhnu)\.ee/g, '://$1.ee');
} else if (TLD == '.hr') {
line = line.replace(/\:\/\/www\.(slobodnadalmacija)\.hr/g, '://$1.hr');
} else if (TLD == '.es') {
line = line.replace(/\:\/\/www\.(turist\.ucoz)\.es/g, '://$1.es');
} else if (TLD == '.dk') {
line = line.replace(/\:\/\/www\.(ue)\.dk/g, '://$1.dk');
} else if (TLD == '.cz') {
line = line.replace(/\:\/\/www\.(vets\.estranky)\.cz/g, '://$1.cz');
} else if (TLD == '.zm') {
line = line.replace(/\:\/\/www\.(visitzambia\.co)\.zm/g, '://$1.zm');
} else if (TLD == '.pl') {
line = line.replace(/\:\/\/www\.(wspolczesna)\.pl/g, '://$1.pl');
}
 
return line;
});
}
 
if (txt.indexOf('{{внешние ссылки}}') > -1) {
if (categories.indexOf('Шаблон «Внешние ссылки» пуст') > -1) { r(/\n?{{внешние ссылки}}\n?/g, ''); }
}
 
if (txt.indexOf('stub}}') > -1) {
if (confirm('убрать stub-шаблон?')) { r(/\n?{{[^\}]+stub}}\n?/g, ''); }
}
 
r(/{{ *[Зз]начения *\|/g, '{{другие значения|');
r(/{{ *[Кк]ар(Сер|тографический сервис) *\|/g, '{{ГИС|');
r(/{{ *[Кк]лимат города/g, '{{Климат местности');
r(/{{ *[Кк]нига\:РесПовВодСССР/g, '{{Книга:РПВ ГИ');
r(/{{ *[Nn]um/g, '{{число');
 
//автозапрос АИ для раздела
//r(/==(.+?)==([^@]+?)==/g, function ( line, name_part, text_part ) {
 
// if ( name_part.indexOf('Притоки') !== -1 || name_part.indexOf('Бассейн') !== -1 || name_part.indexOf('Ссылки') !== -1 || name_part.indexOf('Литература') !== -1 || name_part.indexOf('Примечания') !== -1 || name_part.indexOf('Источники') !== -1 ) { return line; }//сбросить
 
// if ( text_part.indexOf('ref') !== -1 || text_part.indexOf('sfn') !== -1 ) { return line; }//сбросить
 
// return '==' + name_part + '==\n{{' + 'подст:отсутствие источников в разделе' + '}}\n' + text_part + '==';
//});
 
//чистка шаблонов-перенаправлений
r(/{{([^\|\}\n]+)/g, function ( line, template ) {
if (typeof source_code0 === 'undefined') {
var oRequest = new XMLHttpRequest();//загрузка info
oRequest.open('GET', 'https://ru.wikipedia.org/w/index.php?action=edit&title=' + mw.config.get('wgPageName'), false);
oRequest.send(null);
source_code0 = oRequest.responseText.toLowerCase();
}
 
if ( template == 'iw' || template == 'ГКГН' || template == 'ГЕУ' || template == 'СНГОСНГ' || template == 'ИПТ' || template == 'ССГН' ) {
return '{{' + template;//пропускать эти шаблоны-перенаправления
}
 
if ( source_code0.indexOf('class="mw-redirect" title="шаблон:' + template.toLowerCase() + '"') > -1 ) {
var oRequest = new XMLHttpRequest();//загрузка info
oRequest.open('GET', 'https://ru.wikipedia.org/w/api.php?action=query&format=xml&prop=info&redirects=1&titles=Шаблон%3A' + template, false);
oRequest.send(null);
xml = oRequest.responseText;
 
if (xml.indexOf('redirects') > -1) {
var template_new = xml.match(/title=\"Шаблон\:([^\"]+)\"/)[1];
 
if (template_new.length < 18 || template_new.length/2 < template.length) {//заменить если превышает не более чем вдвое или меньшей длины чем средний шаблон по ВО
if (template.toLowerCase() == template) {//установить исходный регистр
template_new = template_new.toLowerCase();
}
 
template = template_new;
}
}
}
 
return '{{' + template;
});
 
//чистка статей-перенаправлений
r(/\[\[([^\|\]]+)([\|\]])/g, function ( line, article, stop ) {//доделать: исключить категории
if (typeof source_code1 === 'undefined') {
var oRequest = new XMLHttpRequest();//загрузка info
oRequest.open('GET', 'https://ru.wikipedia.org/wiki/' + mw.config.get('wgPageName'), false);
oRequest.send(null);
source_code1 = oRequest.responseText.toLowerCase();
}
 
if (source_code1.indexOf('class="mw-redirect" title="' + article.toLowerCase() + '"') > -1) {
var oRequest = new XMLHttpRequest();//загрузка info
oRequest.open('GET', 'https://ru.wikipedia.org/w/api.php?format=xml&action=query&prop=info&redirects=1&titles=' + article, false);
oRequest.send(null);
xml = oRequest.responseText;
 
if (xml.indexOf('redirects') > -1 && xml.indexOf('tofragment') == -1 ) {
article_new = xml.match(/title=\"([^\"]+)\"/)[1];
 
if (article.toLowerCase() == article) {//установить исходный регистр
article_new = article_new.toLowerCase();
}
 
var article = (stop == '|') ? article_new : article_new + '|' + article;
}
}
 
return '[[' + article + stop;
});
 
r(/[^\(]\[\[\:([A-z][A-z])\:(.*?)\|(.*?)\]\]/g, ' \{\{iw|$3<!-- Заголовок статьи подставлен автоматически! Пожалуйста, проверьте корректность и удалите сообщение! -->|$3|$1|$2}}');
 
//r(/–/g, '-');//замена среднего тире
 
r(/{{[Пп]римечания\|2}}/g, '{{примечания}}');//параметр отключён
r(/([А-яЁё])·([А-яЁё])/g, '$1⋅$2');//замена интерпункта
r(/­/g, '');//удаление символа переноса в словах
r(/‐/g, '-');//замена настоящего дефиса
r(/ /g, ' ');//замена табуляций
r(/\.\.\./g, '…');//замена троеточий
r(/ ([\:\;\.\,])/g, '$1');//выпил пробелов перед знаками пунктуации
r(/\s*\< *\/ *ref *\>/g, '</ref>');//лишние пробелы
r(/\<!-- *DASHBot *--\>/g, '');//всегда удалять
r(/\<!-- *в км² *--\>/g, '');//всегда удалять
r(/\<!-- *в км *--\>/g, '');//всегда удалять
r(/\<!-- *в м *--\>/g, '');//всегда удалять
r(/\n *\| *region.+\n/g, '\n');//всегда удалять, осталось Физгео
r(/\| *Исток *= *-([^ ])/g, '|Исток = - $1');//пробел после отключения автовикификации
 
 
r(/\[(\/\/[a-z][a-z]\.wikipedia\.org)/g, '[https:$1');
 
//упаковка ссылок в шаблон Книга
r(/{{[Кк]нига([^\}]+?)}} *{{[Ww]ayback *\| *url *= *([^\|\}]+?) *\| *date *= *([\d]+?) *}}/g, function ( line, params, url, datetime ) {
params = params.replace(/\| *ссылка *= *[^\|\}\s]+/g, '|ссылка = https://web.archive.org/web/' + datetime + '/' + url);
 
return '{{книга' + params + '}}';
});
 
//форматирование шаблона Книга
r(/{{[Кк]нига[^\:][^\}]+?({{|}})/g, function ( line ) {
 
line = line.replace(/([А-ЯЁ]\.)([А-ЯЁ]\.)/g, '$1 $2');//неразрывный пробел в инициалах
line = line.replace(/\|автор *=\s*([А-ЯЁ]\.\s[А-ЯЁ]\.)\s([А-ЯЁ][а-яё]+)/g, '|автор = $2 $1');//инициалы в конец, 1-й автор
for (let i = 0; i < 15; i++) {
line = line.replace(/\|автор *=([^\|\}]+?)\s([А-ЯЁ]\.\s[А-ЯЁ]\.)\s([А-ЯЁ][а-яё]+)/g, '|автор =$1 $3 $2');
}
 
line = line.replace(/\|ref *= *([\n\|\}])/g, '$1');//убрать пустые ref
line = line.replace(/\|isbn2 *= *([\n\|\}])/g, '$1');//убрать пустые isbn2
line = line.replace(/\|том *= *([\n\|\}])/g, '$1');//убрать пустые том
line = line.replace(/\|серия *= *([\n\|\}])/g, '$1');//убрать пустые серия
line = line.replace(/\|оригинал *= *([\n\|\}])/g, '$1');//убрать пустые оригинал
line = line.replace(/\|викитека *= *([\n\|\}])/g, '$1');//убрать пустые викитека
line = line.replace(/\|столбцы *= *([\n\|\}])/g, '$1');//убрать пустые столбцы
 
line = line.replace(/\|место *= *\{\{N. Y.\}\}/g, '|место = N. Y.');//автоподдержка
line = line.replace(/\|место *= *\{\{К\.?\}\}/g, '|место = К.');//автоподдержка
line = line.replace(/\|место *= *\{\{[Лл]\.?\}\}/g, '|место = Л.');//автоподдержка
line = line.replace(/\|место *= *\{\{[Мм]\.?\}\}/g, '|место = М.');//автоподдержка
line = line.replace(/\|место *= *\{\{Мн\.?\}\}/g, '|место = Мн.');//автоподдержка
line = line.replace(/\|место *= *\{\{Пг\.?\}\}/g, '|место = Пг.');//автоподдержка
line = line.replace(/\|место *= *\{\{СПб\.?\}\}/g, '|место = СПб.');//автоподдержка
line = line.replace(/\|место *= *Спб\.?/g, '|место = СПб.');//автоподдержка
 
line = line.replace(/\|[\s]+/g, '|');//для упрощения регулярок ниже
line = line.replace(/\|язык *= *(mis|und)?/g, '|язык = ');//для упрощения регулярок ниже
 
var label = line.match(/\|заглавие *= *([^\|\}]+)/)[1];
 
if (line.indexOf('|язык =') == -1)
{
if (label.replace(/[a-z]/g, '') != label) {
 
if (confirm('В статье обнаружена книга без указанного языка: ' + label + '. Добавить английский?')) {
 
line = line.replace(/}}/g, ' |язык = en}}');
}
else if (confirm('В статье обнаружена книга без указанного языка: ' + label + '. Добавить испанский?')) {
 
line = line.replace(/}}/g, ' |язык = es}}');
}
else if (confirm('В статье обнаружена книга без указанного языка: ' + label + '. Добавить немецкий?')) {
 
line = line.replace(/}}/g, ' |язык = de}}');
}
else {
line = line.replace(/}}/g, ' |язык = }}');
}
}
else if (confirm('В статье обнаружена книга без указанного языка: ' + label + '. Добавить русский?')) {
 
line = line.replace(/}}/g, ' |язык = ru}}');
}
else {
line = line.replace(/}}/g, ' |язык = }}');
}
}
 
//декодирование ссылок
if ( line.indexOf( '%D' ) !== -1 && line.indexOf( '%25' ) === -1 ) {
 
if (confirm('Раскодировать ссылки в шаблоне Книга? ' + line))
{
url = line.match(/\|ссылка *= *([^ \n\|\}]+)/);
 
try {
url_decode = decodeURI( url[1] );
url_decode = url_decode.replace( /%(3B|2F|2C|3A)/g, decodeURIComponent ); // декодировать ;/,:
url_decode = url_decode.replace( /[ <>"\[\]\n\r]/g, encodeURIComponent ); // закодировать
 
line = line.replace(url[1], url_decode);
} catch ( e ) { }
}
}
 
return line;
});
 
//форматирование шаблона Статья
r(/{{[Сс]татья[^\}]+?}}/g, function ( line ) {
 
line = line.replace(/\|[\s]+/g, '|');//для упрощения регулярок ниже
 
line = line.replace(/([А-ЯЁ]\.)([А-ЯЁ]\.)/g, '$1 $2');//неразрывный пробел в инициалах
line = line.replace(/\|автор *=\s*([А-ЯЁ]\.\s[А-ЯЁ]\.)\s([А-ЯЁ][а-яё]+)/g, '|автор = $2 $1');//инициалы в конец, 1-й автор
for (let i = 0; i < 15; i++) {
line = line.replace(/\|автор *=([^\|\}]+?)\s([А-ЯЁ]\.\s[А-ЯЁ]\.)\s([А-ЯЁ][а-яё]+)/g, '|автор =$1 $3 $2');
}
 
//декодирование ссылок
if ( line.indexOf( '%D' ) !== -1 && line.indexOf( '%25' ) === -1 ) {
 
if (confirm('Раскодировать ссылки в шаблоне Статья? ' + line))
{
url = line.match(/\|ссылка *= *([^ \n\|\}]+)/);
 
try {
url_decode = decodeURI( url[1] );
url_decode = url_decode.replace( /%(3B|2F|2C|3A)/g, decodeURIComponent ); // декодировать ;/,:
url_decode = url_decode.replace( /[ <>"\[\]\n\r]/g, encodeURIComponent ); // закодировать
 
line = line.replace(url[1], url_decode);
} catch ( e ) { }
}
}
 
return line;
});
 
//упаковка ссылок в шаблон Cite book
r(/{{[Cc]ite book([^\}]+?)}} *{{[Ww]ayback *\| *url *= *([^\|\}]+?) *\| *date *= *([\d]+?) *}}/g, function ( line, params, url, datetime ) {
params = params.replace(/\| *url *= *[^\|\}\s]+/g, '|url = https://web.archive.org/web/' + datetime + '/' + url);
 
return '{{cite book' + params + '}}';
});
 
//замена ссылок в шаблоне Cite book
r(/{{[Cc]ite book[^\}]+?\| *archiveurl *= *([^\|\}\s]+)[^\}]+?}}/g, function ( line, archiveurl ) {
line = line.replace(/\| *url *= *[^\|\}\s]+/g, '|url = ' + archiveurl);
line = line.replace(/\| *archiveurl *= *[^\|\}\s]+/g, '');
line = line.replace(/\| *archivedate *= *[^\|\}\s]+/g, '');
line = line.replace(/\| *deadlink *= *[^\|\}\s]+/g, '');
 
return line;
});
 
//форматирование шаблона Cite web
r(/{{[Cc]ite web([^\}]+?)}}/g, function ( line, params ) {
 
line = line.replace(/([А-ЯЁ]\.)([А-ЯЁ]\.)/g, '$1 $2');//неразрывный пробел в инициалах
line = line.replace(/\|author *=\s*([А-ЯЁ]\.\s[А-ЯЁ]\.)\s([А-ЯЁ][а-яё]+)/g, '|author = $2 $1');//инициалы в конец, 1-й автор
for (let i = 0; i < 15; i++) {
line = line.replace(/\|author *=([^\|\}]+?)\s([А-ЯЁ]\.\s[А-ЯЁ]\.)\s([А-ЯЁ][а-яё]+)/g, '|author =$1 $3 $2');
}
 
params = params.replace(/\|authorlink *= *([\n\|\}])/g, '$1');//убрать пустые authorlink
params = params.replace(/\|coauthors *= *([\n\|\}])/g, '$1');//убрать пустые coauthors
 
params = params.replace(/\|[\s]+/g, '|');//для упрощения регулярок ниже
 
params = params.replace(/\|website *= *http(s)?\:\/\/([^\/ \|\}]+)[^\|\} ]*/g, '|website = $2');//убрать лишние ссылки
 
params = params.replace(/\|url\-status *= *live/g, '|deadlink = no');
params = params.replace(/\|url\-status *= *unfit/g, '|deadlink = yes');
params = params.replace(/\|url\-status *= *usurped/g, '|deadlink = yes');
 
//декодирование ссылок
if ( params.indexOf( '%D' ) !== -1 && params.indexOf( '%25' ) === -1 ) {
 
if (confirm('Раскодировать ссылки в шаблоне Cite web? ' + line))
{
archiveurl = params.match(/\|archiveurl *= *([^ \n\|\}]+)/);
 
try {
archiveurl_decode = decodeURI( archiveurl[1] );
archiveurl_decode = archiveurl_decode.replace( /%(3B|2F|2C|3A)/g, decodeURIComponent ); // декодировать ;/,:
archiveurl_decode = archiveurl_decode.replace( /[ <>"\[\]\n\r]/g, encodeURIComponent ); // закодировать
 
params = params.replace(archiveurl[1], archiveurl_decode);
} catch ( e ) { }
 
url = params.match(/\|url *= *([^ \n\|\}]+)/);
 
try {
url_decode = decodeURI( url[1] );
url_decode = url_decode.replace( /%(3B|2F|2C|3A)/g, decodeURIComponent ); // декодировать ;/,:
url_decode = url_decode.replace( /[ <>"\[\]\n\r]/g, encodeURIComponent ); // закодировать
 
params = params.replace(url[1], url_decode);
} catch ( e ) { }
}
}
 
//подгон формата даты и чистка
params = params.replace(/\|(accessdate|date) *= *([0-9][0-9][0-9][0-9])\-([0-9])\-/g, '|$1 = $2-0$3-');
params = params.replace(/\|(accessdate|date) *= *([0-9][0-9][0-9][0-9]\-[0-9][0-9])\-([0-9])([^0-9])/g, '|$1 = $2-0$3$4');
params = params.replace(/\|archivedate *= *([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])[0-9]+/g, '|archivedate = $1-$2-$3 ');
 
return '{{cite web' + params + '}}';
});
 
//распил архивных ссылок в Cite web
r(/{{[Cc]ite web[^\}]+?\| *url *= *(http(s)?:\/\/web\.archive\.org\/web\/([\d][\d][\d][\d])([\d][\d])([\d][\d])[\d]+\/(http(s)?:[^ \|\}]+))[^\}]*?}}/g, function ( line, archiveurl, und0, year, month, day, url ) {
line = line.replace(/\| *deadlink *= *no/g, '|deadlink = yes');
 
line = line.replace(/\| *website *= *web\.archive\.org/g, '|website = ');
line = line.replace(/\| *publisher *= *web\.archive\.org/g, '|publisher = ');
 
line = line.replace(/\| *url *=/g, '|url = ' + url + ' |archivedate = ' + year + '-' + month + '-' + day + ' |archiveurl = ');
 
if (line.indexOf('deadlink') == -1)
{
line = line.replace(/}}/g, '|deadlink = yes}}');
};
 
return line;
});
 
//упаковка РПВ ГИ в шаблон
r(/\>[^<]*?Ресурсы поверхностных вод СССР. Гидрологическая изученность. Том 14 Средняя Азия. Выпуск 3[^<]*?\</g, '>{{книга:РПВ ГИ|14|3|страницы = }}<');
 
//оформление шаблоном ссылки на файл с озёрами Псковской области, осталось в АТЕ
r(/\>[^<]*?priroda\.pskov\.ru\/sites\/default\/files\/Fond_vodoemov\.xls[^<]*?\</g, '>{{ФВПО}}<');
 
//фикс
r(/\n *\| *Страна *= *КНР/g, '\n |Страна = Китай');
r(/\n *\| *Страна *= *Китайская Народная Республика/g, '\n |Страна = Китай');
});