mediawiki-projects-list 2.3.7 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +6 -2
  2. package/package.json +1 -1
  3. package/projects.json +124 -0
package/index.js CHANGED
@@ -98,7 +98,7 @@ function inputToWikiProject(input) {
98
98
  if ( wikiProject ) {
99
99
  let articlePath = ( wikiProject.regexPaths ? '/' : wikiProject.articlePath.split('?')[0] ).replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
100
100
  let scriptPath = ( wikiProject.regexPaths ? '/' : wikiProject.scriptPath ).replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
101
- let regex = input.match( new RegExp( wikiProject.regex + `(?:${articlePath}|${scriptPath}|/?$)` ) );
101
+ let regex = input.match( new RegExp( '(?:[\\w%]+(?::[\\w%]+)?@)?' + wikiProject.regex + `(?:${articlePath}|${scriptPath}|/?$)`, 'd' ) );
102
102
  if ( regex ) {
103
103
  scriptPath = wikiProject.scriptPath;
104
104
  articlePath = wikiProject.articlePath;
@@ -110,9 +110,13 @@ function inputToWikiProject(input) {
110
110
  articlePath = articlePath.replace( '?', '$1?' );
111
111
  }
112
112
  else articlePath += '$1';
113
+ let auth = '';
114
+ if ( regex.index < regex.indices[1][0] ) {
115
+ auth = input.slice(regex.index, regex.indices[1][0]);
116
+ }
113
117
  result = {
114
118
  fullArticlePath: 'https://' + regex[1] + articlePath,
115
- fullScriptPath: 'https://' + regex[1] + scriptPath,
119
+ fullScriptPath: 'https://' + auth + regex[1] + scriptPath,
116
120
  wikiProject: wikiProject
117
121
  };
118
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediawiki-projects-list",
3
- "version": "2.3.7",
3
+ "version": "3.0.1",
4
4
  "type": "commonjs",
5
5
  "description": "List of MediaWiki projects for use in discord-wiki-bot",
6
6
  "main": "index.js",
package/projects.json CHANGED
@@ -1990,6 +1990,130 @@
1990
1990
  "scriptPath": "/",
1991
1991
  "fullScriptPath": "https://wiki.insanityflyff.com/"
1992
1992
  },
1993
+ {
1994
+ "name": "stowiki.net",
1995
+ "regex": "((?:www\\.)?stowiki\\.net)",
1996
+ "articlePath": "/wiki/",
1997
+ "scriptPath": "/w/",
1998
+ "fullScriptPath": "https://stowiki.net/w/"
1999
+ },
2000
+ {
2001
+ "name": "lexicanum.com",
2002
+ "regex": "(([a-z\\d-]{1,50})\\.lexicanum\\.com)",
2003
+ "articlePath": "/wiki/",
2004
+ "scriptPath": "/mediawiki/",
2005
+ "idString": {
2006
+ "regex": "([a-z\\d-]{1,50})",
2007
+ "scriptPaths": [
2008
+ "https://$1.lexicanum.com/mediawiki/"
2009
+ ]
2010
+ }
2011
+ },
2012
+ {
2013
+ "name": "dnd-wiki.org",
2014
+ "regex": "(dnd-wiki\\.org)",
2015
+ "articlePath": "/wiki/",
2016
+ "scriptPath": "/w/",
2017
+ "fullScriptPath": "https://dnd-wiki.org/w/"
2018
+ },
2019
+ {
2020
+ "name": "wiki.twcenter.net",
2021
+ "regex": "(wiki\\.twcenter\\.net)",
2022
+ "articlePath": "/index.php?title=",
2023
+ "scriptPath": "/",
2024
+ "fullScriptPath": "https://wiki.twcenter.net/"
2025
+ },
2026
+ {
2027
+ "name": "incels.wiki",
2028
+ "regex": "((?:www\\.)?incels\\.wiki)",
2029
+ "articlePath": "/w/",
2030
+ "scriptPath": "/",
2031
+ "fullScriptPath": "https://incels.wiki/"
2032
+ },
2033
+ {
2034
+ "name": "wiki.mushureport.com",
2035
+ "regex": "(wiki\\.mushureport\\.com)",
2036
+ "articlePath": "/wiki/",
2037
+ "scriptPath": "/",
2038
+ "fullScriptPath": "https://wiki.mushureport.com/"
2039
+ },
2040
+ {
2041
+ "name": "marcaargentea.net",
2042
+ "regex": "((?:www\\.)?marcaargentea\\.net)",
2043
+ "articlePath": "/wiki/index.php/",
2044
+ "scriptPath": "/wiki/",
2045
+ "fullScriptPath": "https://www.marcaargentea.net/wiki/"
2046
+ },
2047
+ {
2048
+ "name": "old-games.ru",
2049
+ "regex": "((?:www\\.)?old-games\\.ru)",
2050
+ "articlePath": "/wiki/",
2051
+ "scriptPath": "/wiki/",
2052
+ "fullScriptPath": "https://www.old-games.ru/wiki/"
2053
+ },
2054
+ {
2055
+ "name": "kovopedia.com",
2056
+ "regex": "((?:www\\.)?kovopedia\\.com)",
2057
+ "articlePath": "/wiki/",
2058
+ "scriptPath": "/",
2059
+ "fullScriptPath": "https://kovopedia.com/"
2060
+ },
2061
+ {
2062
+ "name": "enpedia.rxy.jp",
2063
+ "regex": "(enpedia\\.rxy\\.jp)",
2064
+ "articlePath": "/wiki/",
2065
+ "scriptPath": "/w/",
2066
+ "fullScriptPath": "https://enpedia.rxy.jp/w/"
2067
+ },
2068
+ {
2069
+ "name": "place-wiki.stefanocoding.me",
2070
+ "regex": "(place-wiki\\.stefanocoding\\.me)",
2071
+ "articlePath": "/wiki/",
2072
+ "scriptPath": "/",
2073
+ "fullScriptPath": "https://place-wiki.stefanocoding.me/"
2074
+ },
2075
+ {
2076
+ "name": "wiki.london2038.com",
2077
+ "regex": "(wiki\\.london2038\\.com)",
2078
+ "articlePath": "/",
2079
+ "scriptPath": "/",
2080
+ "fullScriptPath": "https://wiki.london2038.com/"
2081
+ },
2082
+ {
2083
+ "name": "quelmarwiki.com",
2084
+ "regex": "(quelmarwiki\\.com)",
2085
+ "articlePath": "/wiki/",
2086
+ "scriptPath": "/",
2087
+ "fullScriptPath": "https://quelmarwiki.com/"
2088
+ },
2089
+ {
2090
+ "name": "sindenwiki.org",
2091
+ "regex": "((?:www\\.)?sindenwiki\\.org)",
2092
+ "articlePath": "/wiki/",
2093
+ "scriptPath": "/",
2094
+ "fullScriptPath": "https://www.sindenwiki.org/"
2095
+ },
2096
+ {
2097
+ "name": "love2d.org",
2098
+ "regex": "((?:www\\.)?love2d\\.org)",
2099
+ "articlePath": "/wiki/",
2100
+ "scriptPath": "/w/",
2101
+ "fullScriptPath": "https://love2d.org/w/"
2102
+ },
2103
+ {
2104
+ "name": "otherkin.wiki",
2105
+ "regex": "((?:www\\.)?otherkin\\.wiki)",
2106
+ "articlePath": "/o/",
2107
+ "scriptPath": "/w/",
2108
+ "fullScriptPath": "https://otherkin.wiki/w/"
2109
+ },
2110
+ {
2111
+ "name": "transminecraft.gay",
2112
+ "regex": "((?:www\\.)?transminecraft\\.gay)",
2113
+ "articlePath": "/wiki/",
2114
+ "scriptPath": "/w/",
2115
+ "fullScriptPath": "https://transminecraft.gay/w/"
2116
+ },
1993
2117
  {
1994
2118
  "name": "liquipedia.net",
1995
2119
  "regex": "((?:www\\.)?liquipedia\\.net/([a-z\\d]{1,50}))",