text: "use strict";
  
  var fs = require('fs');
  var sanitize = require("sanitize-filename");
  var path = require("path");
  var _ = require("lodash");
  var filendir = require('filendir');
  var doc = "\n/Moba Games/Defense of the Ancients 2\n[/r/Dota2](https://discord.gg/0Pj5D1QKnYAR4GQ7) (Decency)\n\n/Moba Games/Heroes of the Storm\n[HoTS](https://discord.gg/0SLRrvrOn5DdcrHU) (???)\n\n/Moba Games/League of Legends\n[League of Legends](http://discord.me/leagueoflegends) (Redarax)\n\n/Moba Games/Overwatch\n[Official Overwatch Recruiting](https://discord.gg/0aP2XiSkO7ekjro4) (/r/Overwatch)\n\n/Moba Games/Smite\n[Smite](https://discord.gg/0U54RVEbDtnOU2wa) (MusicFanMatt)\n\n/FPS Games/ARMA\n[ARMA](https://discord.gg/0aWSevYPq5TDcIVl) (Dwarden)\n\n/FPS Games/ARMA\n[CSGO &amp; ARMA](https://discord.gg/0bjJaM6bU5Z324XR) (svensson)\n\n/FPS Games/Call of Duty\n[Call of Duty MW2](https://discord.gg/0WoT0DZy2J0Ub1lC) (Chortas)\n\n/FPS Games/Counter-Strike Global Offensive\n[CounterStrike:GO](https://discord.gg/0TIJM4joeU3XmRWO) (Elesoterik)\n/FPS Games/Counter-Strike Global Offensive\n[CSGO:Armory](https://discord.gg/0OtKo9Dvtv2LuGKT) (RusticDusty - CSGO_Armory)\n\n/FPS Games/Insurgency\n[Insurgency](https://discord.gg/0YOLsfWWZSvS0jHe) (xtrosis)\n\n/FPS Games/Killing Floor 2\n[KF2](https://discord.gg/0YmeWp0IqRUndLXx) (Codeman)\n\n/FPS Games/Lawbreakers\n[Lawbreakers](https://discord.gg/0beOgQRI9jcn7gRq) (Derpelle)\n\n/FPS Games/Left 4 Dead 2\n[L4D2](https://discord.gg/0YmpIAl4WCls4SLK) (Codeman)\n\n/FPS Games/Unreal Tournament 4\n[Unreal Tournament 4](https://discord.gg/0UgVfEa2r2CwcjJg) (Storm)\n\n/FPS Games/Warframe\n[Visions of Decay](https://discord.gg/0Qj6myIvIZgVf5zr) (Rednuker)\n\n/FPS Games/Reflex\n[ReflexFPS](https://discord.gg/0SrnNbgr3f6Mz9kt) (Narzdy)\n\n/FPS Games/Team Fortress 2\n[Unofficial /r/tf2](https://discord.gg/0aDTtF09VPlNTg0Q) (Pikscast)\n\n/FPS Games/Tom Clancy's\n[Zeek's](https://discord.gg/0UFWrEF4SVEmdEQ4) (Ziky)\n\n/FPS Games/Warhammer\n[Warhammer Endtimes: Vermintide](https://discord.gg/0ZPZTcCUTVgk7DjS) (yorun0)\n\n\n\n\n/MMO/ArcheAge\n[ArcheAge] (https://discord.gg/0bFdc0b8FTTy3jpL) (NSA-SURVEILLANCE)\n\n/MMO/Albion Online\n[Unofficial Official Albion Online](https://discord.gg/0bTHLBlzzUrJUbnC) (???)\n\n/MMO/Closers Dimension Conflict\n[ClosersHQ Official Chat](https://discord.gg/0S3aWQEkIlWcA2CD) (CaseyHQ)\n\n/MMO/Crowfall MMO\n[Crowfall](https://discord.gg/0MDCm6IEmg1BF8Ui) (Youma)\n\n/MMO/Devilion MMO\n[Devilion Community](https://discord.gg/0Mgy9tqnN39ctFsm) (Zoltariel)\n\n/MMO/Diablo\n[NoSympathy](https://discord.gg/0TAtzhBDJhJiC9Ie) (CrossOvver)\n/MMO/Diablo\n[Diablo3](https://discord.gg/0aOBBxGmOoM5IJ25) (Jeggott)\n\n/MMO/Dofus\n[Dofus](https://discord.gg/0RDH0dqUoTRFbwy9) (Wabacus)\n\n/MMO/Dragon Nest\n[DNSWorld](https://discord.gg/0VcwAnzwc0KNfgML) (DNSQueenie)\n/MMO/Dragon Nest\n[Dragon Nest NA](https://discord.gg/0aoJVkoXoNwFEUea) (Comphus)\n\n/MMO/Dungeons and Dragons Online\n[Dungeons and Dragons online](https://discord.gg/0beK2190IXGADXLl) (ILoveTheSauce)\n\n/MMO/Elite Dangerous\n[/r/Elite Dangerous](https://discord.gg/0V5hfT4eO8fN9Q6K) (???)\n\n/MMO/FFXIV\n[Heavensward](https://discordapp.com/invite/0HCCgO4RbqVjgShp) (Djritful)\n/MMO/FFXIV\n[(chaos)XIV Cerberus](https://discord.gg/0ZxYbZOJBFGPHFCA) (KuraBloodlust)\n/MMO/FFXIV\n[FFXIV - Adamantoise](https://discord.gg/0a7yOKD02XGkhkX1) (Akaharu)\n/MMO/FFXIV\n[FFXIV - Odin](https://discord.gg/0aBuERD9ZVV8BFqq) (KuraBloodLust)\n/MMO/FFXIV\n[FFXIV - Leviathan](https://discord.gg/0aBJkEDJGsBMDNON) (Supesupe)\n/MMO/FFXIV\n[FFXIV - Ultros](https://discord.gg/0alCJcRuekEnn3Ha) (Carlie)\n\n/MMO/Grand Theft Auto\n[GTAV](https://discord.gg/0be1cpMpjytEZ9CV) (Almighty_Alpaca_)\n\n/MMO/Guild Wars 2\n[Guild Wars 2](https://discord.gg/0b5yVCmhcVt4C6mr) (Sikkle)\n\n/MMO/Marvel Heroes\n[Marvel Heroes](https://discord.gg/0ccQZUu9jSlAF5TH) (vadersdemise)\n\n/MMO/Maplestory 2\n[Maplestory 2](https://discord.gg/0a38agsiVLxNzGz0) (Kirbyfreako)\n\n/MMO/Path of Exile\n[Path of Exile](https://discord.gg/0aPhfOWXrsfz4wk2) (Jeggott)\n\n/MMO/Phantasy Star Online2\n[Phantasy Star Online2](https://discord.gg/0bglEH2Wd4CYzXoV) (italktowalls)\n\n/MMO/Phantasy Star Universe\n[Phantasy Star Universe](https://discord.gg/0cnwyBkDPHhBRM02) (Arcaenist)\n\n/MMO/Rising Thunder\n[Rising Thunder](https://discord.gg/0WTdWwnuayUuFQYH) (RT Reddit)\n\n/MMO/Secrets of Grindea\n[Grindea](https://discord.gg/0OKNQ4xrrE0PRQQM) (yuuki)\n\n/MMO/Tree Of Savior\n[TOSBase](https://discord.gg/0QFW9NDirWevdJtR) (Icystare)\n\n/MMO/Wakfu\n[Wakfu](https://discord.gg/0WL9EEf55J99YJJX) (EN CM Sabi)\n\n/MMO/Wildstar\n[Wildstar](https://discord.gg/0TrMr9NtcKujZXLh) (Jazzy)\n\n/Other Games/Binding of Isaac\n[BoI: Rebirth](https://discord.gg/0bJtYsBveBF0NrbY) (143133515)\n\n/Other Games/Blade and Soul\n[Blade &amp; Soul](https://discord.gg/0TaItTx9qrQce4iU) (IHellMasker)\n\n/Other Games/Chivalry\n[Chivalry: Medieval Warfare](https://discord.gg/0bE4ax5Wpo9w46M4) (Raunhover)\n\n/Other Games/Distance\n[Distance](https://discord.gg/0SlqqvzfIbgVqJB6) (???)\n\n/Other Games/Duelyst\n[Duelyst](https://discord.gg/0WbpmyLbu52aphyb) (Kirbyfreako)\n\n/Other Games/Evolve\n[Evolve](https://discord.gg/0UqXI9nyH0aVU7rr) (Abvex)\n\n/Other Games/Hearthstone\n[Hearthstone](https://discord.gg/0TwrUZr5zGyFd7HX) (Musicfanmatt)\n\n/Other Games/Project Zomboid\n[Ballin Outta Control](https://discord.gg/0OjlJ7zhCLhDTCti) (PaulMck86)\n\n/Other Games/Lost Saga\n[Bravely](https://discordapp.com/invite/0XVkwnDAeKgT2Cbv) (Heikaru)\n\n/Other Games/Mario Kart\n[/r/mariokart](https://discord.gg/0TtGzmNdU5ZxCkgv) (MK Reddit)\n\n/Other Games/Minecraft\n[Minecraft Discord](https://discord.gg/0VAzP14IRxYaC97V) (Milkerfish)\n/Other Games/Minecraft\n[Minecraft Chatter](https://discord.gg/0dy3f6WDsZSJZiWk) (velkovjr)\n\n/Other Games/Osu!\n[osu!](https://discord.gg/0Y1676AR4QQfPn4x) (Repawn)\n\n/Other Games/Pokemon\n[Pokemon](https://discord.gg/0bhCXu6sjstCgVZw) (Sweetogekiss)\n\n/Other Games/Rocket League\n[Rocket League](https://discord.gg/0TDkiRRfZwNBNfA5) (GoodAndy)\n/Other Games/Rocket League\n[Mock-It League](https://discord.gg/0TFuyUvqJ5HxbdCk) (DailyXP)\n\n/Other Games/Smash Bros.\n[Australian Smash](https://discord.gg/0PAW8nxQx9UbYVTq) (Cole)\n\n/Other Games/Smash Bros.\n[r/ssbm](https://discord.gg/0Xeas8JqXwdpX0lR) (/r/ssbm)\n\n/Other Games/Smash Bros.\n[Smash Room Station](https://discord.gg/0bocNVGI8laccC9L) (SlickJ)\n\n/Other Games/Splatoon, Wii\n[/r/Splatoon]() (Carr896)~~Excluded for now~~\n\n/Other Games/Starcraft\n[Team Ascension](https://discord.gg/0Vjzi81e7LFaUhPR) (Travisyang)\n\n/Other Games/Sword of Vermilion\n[Sword of Vermilion](https://discord.gg/0b0ZitR25ZeGGiLT) (johnsonic7)\n\n/Other Games/TCG\n[TCG Central](https://discord.gg/0aGuULuB9C2JbHs4) (Tarrabyte)\n\n/Other Games/Terraria\n[Terraria](https://discord.gg/0U4zNFIJpDCL7GQs) (MusicFanMatt)\n\n/Other Games/The Sims\n[The Sims](https://discord.gg/0YjcYngtdfkBMAxn) (golionz)\n\n/Other Games/Touhou\n[TouhouCraft](https://discord.gg/0U6KAap475vPWss7) (italktowalls)\n\n/Language/ENGLISH\n[[UK] FPS/RTS/RPG](https://discord.gg/0TzxyhJax4nDbITe) (Linkinverse)\n\n/Language/FRENCH\n[Français](https://discord.gg/0Tx7qmKNCj1yivSy) (Matias49)\n\n/Language/DUTCH\n[[NL] FPS/MOBA](https://discord.gg/0Vb7szHL7DblhTFt) (pirates1967)\n\n/Language/SWEDISH\n[Sverige](https://discord.gg/0VnT8iwVFHLNARyZ) (LinHuz)\n\n/Language/SWEDISH\n[Viking TV](https://discord.gg/0aC5X0Q92rmjFDFo) (Mindful &amp; Hofferino)\n\n/Language/INDIA\n[E-Sports India](https://discord.gg/0YlFAx7vf5bUixZQ) (Massacre)\n\n/Language/PORTUGUESE\n[Portugues](https://discord.gg/0a9VvlGWR9CZrdTi) (Immotay)\n\n/Language/PORTUGUESE\n[Tree of Savior Brasil/Portuguese](https://discord.gg/0ZKvX8r7raSMqmdb) (f4th3r)\n\n/Language/HAWAII\n[Hawaii](https://discord.gg/0bGzoHth1yO9NfuW) (wulfys)\n\n/Language/OCEANA\n[Australian Gaming Community](https://discord.gg/0b0To56Uwi2JRQRC) (Smile)\n\n/Language/GERMAN\n[German Public Discord](https://discord.gg/0ddqIS4NAzbKqRLa) (limo5634)\n\n/Other/Unofficial Discord API/Development/Bots\n[DiscordAPI] (https://discord.gg/0SBTUU1wZTV9JAsL) (Voltana)\n/Other/Unofficial Discord API/Development/Bots\n[DiscordDevs](https://discord.gg/0ESuwoZe4M2Xcpeu) (DiscordApp)\n/Other/Unofficial Discord API/Development/Bots\n[DiscordLinux](https://discord.gg/0XKEBLSe6ccP5uYT) (XNBlank)\n/Other/Unofficial Discord API/Development/Bots\n[Discord Bots](https://discord.gg/0cDvIgU2voWn4BaD) (meew0)\n\n/Other/Computers, Consoles and Company\n[Unofficial Gearbox Discord](https://discord.gg/0Ut1Gt2sJo6GTFXa) (Derch1981)\n/Other/Computers, Consoles and Company\n[Unofficial PC Master Race](https://discord.gg/0VEW0OVOGMjjSmzP) (Milkerfish)\n/Other/Computers, Consoles and Company\n[Unofficial Nintendo](https://discord.gg/0VUyTH6zFt3zU3QW) (Terrabyte)\n/Other/Computers, Consoles and Company\n[3DS](https://discord.gg/0UFdpe0x69ZguQw8) (Z3K3Z)\n/Other/Computers, Consoles and Company\n[PSVITA](https://discord.gg/0UKTt8OeVJYaE3gB) (emolittleshit)\n\n/Other/Anime, Manga, Books and Comic Books\n[Animu and Mango](https://discord.gg/0TrxVUwZsSuz9S4j) (Musicfanmatt)\n/Other/Computers, Consoles and Company\n[Japanese Media Management](https://discord.gg/0XKJW7TObKLajoKc) (JMediaManager)\n/Other/Computers, Consoles and Company\n[Comic Book General](https://discord.gg/0aNAiNnGVDNURGbI) (Musicfanmatt)\n/Other/Computers, Consoles and Company\n[Anime Discuss](https://discord.gg/0ccNdvWBCEuw87eD) (xwmario)\n\n/Other/Movies\n[MovieClub](https://discord.gg/0Tx4H0SMzT5Qv46T) (Justintime7474)\n\n/Other/Podcasts\n[PKA/Painkiller](https://discord.gg/0Ud6KT05Ly2NMd3f) (IWishIHadCake)\n[we didnt name this server at all](https://discordapp.com/invite/0VdAmanOQSAnJrfk) (nickroseville)\n\n/Other/Music and Production\n[The Music Bar](https://discord.gg/0TBYxuT95eWrk9RI) (ZeroxSoul)\n/Other/Music and Production\n[Tripulse Community](https://discord.gg/0RfRA4njAeYbZAdl) (Kerosyn)\n/Other/Music and Production\n[ALTEDM] (https://discord.gg/0Y6Is461Ze5ae0w1) (Emmet-Brown)\n/Other/Music and Production\n[Unofficial Monstercat](https://discord.gg/0XzWvesV0VyuKDXW) (TheRealCheesy)\n\n/Other/Social\n[Excelsior](https://discord.gg/0XEr9AdWqkRV18vO) (Zombiex100)\n/Other/Social\n[Social Hub](https://discord.gg/0VIWePEAZcdNDQM5) (LinHuz)\n/Other/Social\n[Hip Slick &amp; Geek](https://discord.gg/0Uk8GIZtbNLEbhaP) (Arlene)\n/Other/Social\n[Digital Aggro](https://discord.gg/0dYZXHVBpaUB7c9e) (Koalas_In_Motion)\n/Other/Social\n[Meebo and Friends](https://discord.gg/0ZP2BxUIC1eQSp4K) (Tarra.exe)\n/Other/Social\n[The Lounge](https://discord.gg/0dIXpWcejNvrhxcS) (wave100)\n/Other/Social\n[Jetty Extermination Squad](https://discord.gg/0cnAU6GetserSFhI) (ApolloJustic3)\n/Other/Social\n[JonTron](https://discord.gg/0YO0Z8gUob4UIa3K) (/r/JonTron)\n\n/Other/Matchmaking\n[Looking for Gamers](https://discord.gg/0bYOie7xMSr4Rd4u) (LFG_Aaron)\n\n/Other/Gaming Communities\n[TeiGen](https://discord.gg/0SIMyY56SC6HF2na) (Top_Kek_Lel)\n/Other/Gaming Communities\n[TeaVanna] (https://discord.gg/0S56f6QSW4nW2uBQ) (XNBlank)\n/Other/Gaming Communities\n[QubeTubers](https://discord.gg/0b0vuxuTg41sc1gN) (syntria)\n/Other/Gaming Communities\n[Fuckboii squad \t1](https://discordapp.com/invite/0V2bHFWgHEZt0GsE) (joeytman)\n/Other/Gaming Communities\n[Adventurer's Guild](https://discordapp.com/invite/0MRCBg85iz6XrZu2) (???)\n/Other/Gaming Communities\n[Abusement Park](https://discord.gg/0YEnlwRYgAEvNz98) (ILoveTheSauce)\n/Other/Gaming Communities\n[ChristOutreachOnline](https://discord.gg/0aFmfZpsrBo0bD1d) (reformed1133)\n/Other/Gaming Communities\n[The Gaming Asylum](https://discord.gg/0akwBlodnwEPZkwp) (Wobbly)\n/Other/Gaming Communities\n[YT Gaming](https://discord.gg/0ctqjoE43BCQhoeJ) (Nizaction)\n/Other/Gaming Communities\n[SSG Gaming Community](https://discord.gg/0dScM24llUezU9LN) (ThatGuyFromAbove_)\n\n";
  var regex = /(.+)\n\[(.+)\]\W?\((.+)\) \((.+)\)/g;
  var result = regex.exec(doc);
  
  while ((result = regex.exec(doc)) !== null) {
    var category = _.trim(result[1], './');
    var _name = _.trim(result[2], '.\/ ');
    var link = result[3];
    var owner = result[4];
    var tags = category.replace('/', ',');
    console.log("processing " + result[2]);
    var contents = "---\nlayout: link\ntitle: \"" + _name + "\"\nlink: " + link + "\nowner: \"" + owner + "\"\ntags: [" + tags + "]\n---\n";
    var filename = _name + '.md';
    var fullpath = path.join('.', category, sanitize(filename));
    console.log("Writing " + _name + " to " + fullpath);
    filendir.writeFileSync(fullpath, contents, 'utf8');
  }