#77 Suggestions for DotNetWikiBot

closed-fixed
nobody
None
5
2010-11-04
2010-07-24
Jutiphan
No

I have been your long-time user for the DotNetWikiBot framework and would like to ask and share couple suggestions I have adjusted your framework over time.

1. Please add [Serializable] attribute for Site, Page, PageList. The reason is because I implemented the Save & Load function for caching so that it would start up faster.
2. Please change back from Private to Public for userPass variable. My application uses multiple bots and multiple sites, and therefore both userName and userPass have to be set. If you are worried about security, I recommend you to implement it as a Properties with set only.
3. In GetPaths function, please add webReq.CookieContainer = new CookieContainer(); around line 278 in v2.94. There seems to be some instance when the cookies would be affected. I then late added foreach (Cookie cookie in webResp.Cookies)
cookies.Add(cookie); around line 321.
4. I adjusted the UndoLastEdits function to return bool. If undo is successful, it returns true, if not it returns false. I also added more error handling: if (pl.pages.Count < i) break; after line 1593.
5. ResolveRedirect function was adjusted to handle some special cases, I added this.lastRevisionID = null; This is needed so that it loads the corrected text, and reset the revisionID so that it loads the lastest rev of the redirected page, because sometimes I found out it loads the incorrect one in certain circumstances.

Thanks!
Jutiphan

Discussion

  • CodeDriller
    CodeDriller
    2010-08-06

    Hi, Jutiphan! Glad to hear you!

    I see no problems in implementing all that.

    What was the exact problem with GetPaths() and cookies?

     
  • CodeDriller
    CodeDriller
    2010-08-06

    • status: open --> open-accepted
     
  • Jorney Huang
    Jorney Huang
    2010-08-09

    I think it is better if the password (userPass) is just a param to the login function.

     
  • CodeDriller
    CodeDriller
    2010-09-14

    Yes, I think xxpkmj is right. Changing account and password on-the-fly and re-logging is a bad idea. It's better to create one more Site object with different credentials.

     
  • CodeDriller
    CodeDriller
    2010-09-17

    • status: open-accepted --> closed-fixed
     
  • CodeDriller
    CodeDriller
    2010-09-17

    Applied in v2.95 except for password change.

     
  • Jutiphan
    Jutiphan
    2010-09-19

    Thanks! I can't remember exactly what was the problem, but I believe it has to do when reusing it for the second time. My scenario and the way I implemented it somehow causes those bugs to be visible. Basically I have 4 main bots, 3 websites, so somehow somewhere crossover reusing it causing cookies not to be saved properly.

     
  • Jutiphan
    Jutiphan
    2010-09-19

    • status: closed-fixed --> open-fixed
     
  • CodeDriller
    CodeDriller
    2010-11-04

    • status: open-fixed --> closed-fixed