Menu

FillFromCustomSpecialPage for ListRedirects

Help
PChott
2010-07-06
2013-05-13
  • PChott

    PChott - 2010-07-06

    I'm trying to get all ListRedirects and i'm having little problem.

    I create request:  pl.FillFromCustomSpecialPage ("ListRedirects", 10);

    and on pl (PageList) I get target pages, but i want to get Redirect pages. Any suggestion how can i do it?

    Thx

     
  • CodeDriller

    CodeDriller - 2010-07-07

    That's a bug and it needs correction.

    For now you can call:

    pl.FillFromCustomSpecialPageEx("ListRedirects", 10);

    (note "Ex" at the end of function name). That function will return PageList, where every odd page is redirect and every even page is target.

     
  • PChott

    PChott - 2010-07-08

    Thx for that info.

    When i try with "Ex" i get error, that i think in not direktly conncted to this:

    (MediaWiki 1.15.4)
    Getting 10 page titles from "Special:ListRedirects" page…

    Unhandled Exception: System.Xml.XmlException: comments cannot contain '-'  Line 129, position 5.
      at Mono.Xml2.XmlTextReader.ReadComment () 
      at Mono.Xml2.XmlTextReader.ReadDeclaration () 
      at Mono.Xml2.XmlTextReader.ReadContent () 
      at Mono.Xml2.XmlTextReader.ReadContent () 
      at Mono.Xml2.XmlTextReader.Read () 
      at System.Xml.XmlTextReader.Read () 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) 
      at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) 
      at System.Xml.XmlDocument.LoadXml (System.String xml) 
      at DotNetWikiBot.PageList.FillFromCustomSpecialPageEx (System.String pageTitle, Int32 quantity) 

     
  • PChott

    PChott - 2010-07-08

    And YES a found '-' in comments of pages

     
  • PChott

    PChott - 2010-07-11

    Juping from one problem to other :P

    Logged in as CleanUpBot.
    Site: e-studij.si (MediaWiki 1.15.4)
    Getting 10 page titles from "Special:ListRedirects" page…

    Unhandled Exception: System.Xml.XmlException: Document type cannot appear in this state.  Line 5, position 10.
      at Mono.Xml2.XmlTextReader.ReadDoctypeDecl () 
      at Mono.Xml2.XmlTextReader.ReadDeclaration () 
      at Mono.Xml2.XmlTextReader.ReadContent () 
      at Mono.Xml2.XmlTextReader.Read () 
      at System.Xml.XmlTextReader.Read () 
      at Mono.Xml.XmlFilterReader.Read () 
      at Mono.Xml.XmlFilterReader.Read () 
      at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Compile () 
      at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Init (System.Xml.XmlReader reader, XmlSpace space, Int32 defaultCapacity) 
      at Mono.Xml.XPath.DTMXPathDocumentBuilder2..ctor (System.Xml.XmlReader reader, XmlSpace space, Int32 defaultCapacity) 
      at Mono.Xml.XPath.DTMXPathDocumentBuilder2..ctor (System.Xml.XmlReader reader, XmlSpace space) 
      at System.Xml.XPath.XPathDocument.Initialize (System.Xml.XmlReader reader, XmlSpace space) 
      at System.Xml.XPath.XPathDocument..ctor (System.Xml.XmlReader reader, XmlSpace space) 
      at System.Xml.XPath.XPathDocument..ctor (System.Xml.XmlReader reader) 
      at DotNetWikiBot.Site.GetXMLIterator (System.String xmlSource, System.String xpathQuery)  in /home/…/DotNetWikiBot.cs:1058
      at DotNetWikiBot.PageList.FillFromCustomSpecialPageEx (System.String pageTitle, Int32 quantity)  in /home/…/DotNetWikiBot.cs:3205
      at MyFirstBot.Workout.IzbrisiOdvecnePreusmeritve (DotNetWikiBot.Site myWiki)  in /home/…/Workout.cs:51
      at MyFirstBot.MainClass.Main (System.String args)  in /home/…/Main.cs:25
    The application was terminated by a signal: SIGHUP

    Line 51 of WorkOuk.cs
    pl.FillFromCustomSpecialPageEx ("ListRedirects", 10);

     
  • CodeDriller

    CodeDriller - 2010-07-11

    Yep. Uploaded once again tohttp://dotnetwikibot.cvs.sourceforge.net/viewvc/dotnetwikibot/framework/DotNetWikiBot.cs.

    Beware that there are some unconventional newline characters in the beginning of HTML pages on e-studij.si. This may pose a problem for some parsers, even for RSS. The usual cause of it are erroneous newline characters in the end of .php files after ?> tag. You should remove it, if you have edited some MediaWiki .php files there.

     
  • PChott

    PChott - 2010-07-11

    Thx. Now it does work.

    BTW is method "IsRedirect" working in general?

    Thx for notice about new lines. I'll try to find which file making that.

     
  • CodeDriller

    CodeDriller - 2010-07-11

    Yes, I checked IsRedirect() function just a couple of days ago. Just don't forget to Load() the page before calling IsRedirect().

     

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.