User:Crazycomputers/VandalSniper/Development

Web browsing
The gecko control is making my life easier and harder at the same time. Multiple instances of the control automatically share cookies and settings, which is cool. But since it assumes a set of default settings that I am not sure how to alter (or even if it is possible) the browser behaves like it was just installed, right down to asking you if you want to submit every form to an insecure server.

The browsing toolbar is going to be hard to get "just right." The buttons are on a Gtk.Toolbar, which has an outset border that cannot be hidden, or I can't find a way to do this, so the address field looks odd... the border just stops before the text field. But if I put the text field inside the toolbar it has a default width and will not fill the bar.
 * The ToolItem widget is a container that will expand to fill unused space. Currently Gtk# does not implement ToolItem (so presumably Glade# pulls the child widget out and throws it right on the Toolbar) so the desired result is not seen when VandalSharp is run, but Glade does display it properly. After Gtk# implements ToolItem the address entry should magically expand with the window.
 * Seems Glade# just isn't turning Expand on, despite the attribute setting. Anyway setting it manually seems to do the trick.

Watchlist
To get the watchlist I need to be logged in, but WebControl offers no way to get either HTML/XHTML source or a DOM object from its contents, nor a way to extract cookies.

RC will not suffer from this problem as the page is identical (barring the user links at the upper-right).

User authorization will need to work around this too.


 * But it does offer a way to write content to the stream, which means we could skip over its cookie processing altogether and use System.Net.HttpWebRequest. (Not sure how we would process forms though.)
 * People have suggested that you can write to the stream even when WebControl handled the request itself, so in theory I can write some JavaScript in to do what I want. Getting information back out of the WebControl may prove to be a challenge.
 * In the most recent version it is not possible to append to a closed stream. But I hacked on jscall (used in the MonoDevelop ASP.NET editor plugin) and added a method to inject a script into a page.  This will allow me to put my own functions in the page, as well as the jscall glue library, which in turn allows me to pass data to and from scripts.

Recent changes
There are three sources that could be used for populating recent changes:

Special:Recentchanges
Would require a bit of work, mostly in the pattern-matching department. Reading in a DOM structure from the HTML and traversing it would make the code more straightforward but would likely break, since generated XHTML is rarely valid.


 * Since Mono's regular expression implemention isn't done I've written a basic tokenizer that takes an array of mixed strings and command tokens to match a pattern. This seems to work well... all of the bugs I encountered were typos in the list of tokens I was feeding it.

Ahhh, MediaWiki's Special:Recentchanges output keeps changing! Hope they settle on something soon if we don't want VandalSniper to break frequently.
 * Alternative: put parsing rules on Wikipedia so a quick change will make everyone's client magically work.

The recent changes RSS feed
This is the approach used now. While (fairly) clean to code, the server seems to refresh the RSS feed every 8-15 seconds. This is not good, as all VandalProof# users would be getting the same list of changes, and would also miss out on a lot of changes. There would be a lot of people patrolling the same 20 edits every 10 seconds.


 * This approach has been abandoned.

IRC channels
This would enable a live feed into the RC list, but would require coding an IRC client or finding one that can be used from .NET. It would probably be more work than it's worth.


 * This approach is on the back burner for now.

Dependencies

 * An implementation of the .NET Framework, such as:
 * Microsoft .NET Framework.
 * Mono development platform.
 * DotGNU.
 * The Gtk# runtime.
 * Linux: Packaged for many major distributions.
 * Windows:
 * Mac OS X: ?
 * The Gecko Runtime Environment (GRE), used by Gecko#.
 * Linux: Packaged for many major distributions.
 * Windows:
 * Mac OS X: ?