Menu

PageList.SaveSmoothly - continue after a Token error

Help
Luca Mauri
2017-07-30
2017-07-30
  • Luca Mauri

    Luca Mauri - 2017-07-30

    Hi there,
    in order to keep a low stress on the Wiki site, i am using the PageList.SaveSmoothly function to save a bunch (usually a few hundreds) of pages.

    Sometimes, during the process i get the Invalid token exception: I saw this topic was discussed some times here, but no definitive solutions seems to have been found.
    So the only thing I can do when I encouter the issue is to restart the process hoping it will run properly at the end.

    What I was thinking about was to take note of the last page saved by PageList.SaveSmoothly before the exception, close the connection, start a new one and then start saving from the previous page.
    The problem is that I do not see any obvious way to determine the last page saved: is there a way to do so that escapes me?

    Tthanks a lot for any help you might provide

    Luca

     
  • CodeDriller

    CodeDriller - 2017-09-28

    The last edited page is listed first on "Special:Contributions/BotName" page.

    PageList.FillFromUserContributions(string userName, int limit) method can be used.

     

    Last edit: CodeDriller 2017-09-28
  • Luca Mauri

    Luca Mauri - 2017-09-30

    Dear CodeDriller,
    unfortunately this does not work.

    First of all, the function only works when the Wiki is in EN language, so I need to change the language each time I need to perform this search.
    Secondly, even changing the language and starting the query again, I always get just one page, a page titled Log out and this is consistently the same regrdless the user I try

    Any idea why this is happening?

    Thanks

    Luca

     
  • CodeDriller

    CodeDriller - 2017-10-10

    No, currently I have no idea. Your site doesn't seem to support English titles of special pages for some reason. This is unusual, and I have no explanation for now.

    What is the site address that you pass to Site() constructor?

     
  • Luca Mauri

    Luca Mauri - 2017-10-29

    Dear CodeDriller,
    thanks, you solved the issue.

    The problem causing my issues was actaully the site address as you suggested.
    For some reason, when I started using your tool, I wrote the string

    _WikiTrek = New DotNetWikiBot.Site("http://www.lucamauri.net/wikitrek/index.php")

    passing the address www.lucamauri.net/wikitrek/index.php: it worked fine on first tests and on pages creation so I never gave a second thought.

    In fact, I now see the correct address should be www.lucamauri.net/wikitrek: with this modification, I was finally able to solve this issue.

    That was very silly on my part, sorry for wasting your time and thanks again for the help.

    Luca

     

    Last edit: Luca Mauri 2018-03-04

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.