I wanted to run a script on a Wikia wiki I never connected before with latest version of DotNetWikiBot (2.99) and got the error "failed to log in". After a litlle digging I figured out the indexpath was not set so bot was considering the following URL: http://mywiki.wikia.comapi.php?action=login (missing / between .com and api.php).
To make it work I tweaked a bit GetPaths method by
* adding "Regex indexPathRE3 = new Regex("(?i)wgScript=\"(/[^\"\\s<>?]*?)index\\.php");"
* changing "indexPath = indexPathRE2.Match(src).Groups.ToString();" by
" if (!site.Contains("wikia.com"))
indexPath = indexPathRE2.Match(src).Groups.ToString();
indexPath = indexPathRE3.Match(src).Groups.ToString();"
Indeed, bot get main page source to determine index.php path, though Wikia is adding a wgScript JS variable in the produced code which indicate where to find it, so why not use it? By the way the full URL with index.php cannot sometimes be found in the main source page.
Log in to post a comment.