Archives for posts with tag: mediawiki

I’ve been looking at web API client libraries in a lot of languages for my OPW internship project: Python, Perl, Ruby, and most recently, Java. Fortunately for me, the Java Wiki Bot Framework (JWBF) is the clear leader in the available libraries, so it was the only one on my list to evaluate.

That evaluation was challenging! I hadn’t written or read any Java since my first CS class–about a decade ago now. Since then, I’ve been working with interpreted languages, not compiled ones (see: Python, Perl, Ruby). The idea of dependencies becoming relevant at compile-time was strange to me (what, you can’t just check whether it’s installed properly with import jwbf?!). I’d never used Maven, and the project-based structure with a zillion subfolders was not intuitive. Auto-generated documentation (JavaDocs) were available, but it wasn’t clear what was expected from one (not to mention what a good one was.

I’ve learned a lot since I started wrestling with this. I now know about:

  • Limitations of JavaDocs. Basically: good for granular description of packages and methods, but your project should really have a separate larger-scale document that talks about design goals and the overall approach behind your implementation.
  • The internal structure of JWBF. mediawiki/actions is where most of the methods you’ll want your bot to use are kept.
  • What the deal with Maven is. Turns out it’s not an IDE, but rather a build automator and a dependency manager. It connects to Maven Central, an online repository that a lot of dependencies can be downloaded from.
  • How to start a project in Maven, how it handles dependencies, and (broadly) how I might use JWBF vs. hack on JWBF.

I also found a handful of debugging links (using the Eclipse IDE), which I haven’t tried myself yet. They’re on the table for next week’s work.

I have about two weeks left in my internship, and in that time I’ll make a handful of improvements for the project. I’ve already starting rewriting the README to be friendlier to and more informative for new Java developers, and soon I’ll start drafting a higher-level supplement to the JavaDocs, including information on which packages a MediaWiki API client developer should start with. Code-wise, I’ll be implementing a search function to address this feature request and writing the tests and documentation to support it.

Advertisements

I am not back from WikiConference USA 2014, but I am settled in here to work and decompress for a few days. I attended the conference to give an intro-level talk and workshop based on my own work getting up to speed with the MediaWiki API, and to meet more of the larger Wikimedia community. I also got the chance to meet technical contributors whom I’d previously only interacted with on IRC and the wikitech-l mailing list. It’s good to be able to put faces to usernames. I also chatted with Asaf Bartov, a contributor to Mediawiki::Gateway. Asaf confirmed my first impressions of the library’s scope and quality–a good check for my work.

So, the talk! If you’re interested in the basics of web APIs (or MediaWiki’s in particular), my slides are available on Wikimedia Commons. Video for the talks will be up soon–see the WikiConference USA 2014 category for more photos.

Slides for talk
Slides for workshop/demo

I aimed the talk at an audience that was not wholly nontechnical but that would include non-programmers. Based on this feedback, it looks like I succeeded! https://twitter.com/kos2/status/472415903993589761https://twitter.com/kos2/status/472415903993589761

More highlights of the conference:

Sunday was the open space/unconference day. We started off with lightning talks (I talked about the Seattle Attic as a feminist hackerspace) and then I attended Sumana’s Diversity/Ally Skills training, using the Ada Initiative’s publicly licensed materials. We had about an hour until the next round of lightning talks (very cool stuff: Book scanners! Publicly available Israeli laws! 5-shot method of shooting video! Gender visualizations! Wikidata and maps!) so we only got through a couple of scenarios. The attendees at the Ally Skills training had wanted to keep going, so I agreed to lead another session in the afternoon.

It was an interesting experience, and it sounded like many of the attendees got a lot out of it. It was surprisingly/not surprisingly emotionally draining to run but I was glad to be able to offer this. The workshop offers concrete suggestions about how to deal with sexist words and actions as they come up, as well as some basic feminist background for people who may never have considered how some of these principles apply to their own life, and does it in the format of private small-group discussions. I am grateful to everyone who participated, shared, and listened in both of the sessions yesterday. I suspect that those conversations gave many of us things to think about. They certainly did to me.

This summer I’m taking part in the Outreach Program for Women, working on making the MediaWiki API more usable. As a part of this, I’ll be blogging every week or two with things I’ve done, things I’ve learned, or general thoughts as I get into the free/open source software world.

When my mentor mentioned that she had a project that could use an intern, I was not 100% clear on what an API (Application Programming Interface) was. I knew it had something to do with another way to interact with websites without actually having to visit the relevant webpages, but I’d never given it much thought.

I was interested, though. I went off for some quality research time and about ten days later I’d finished the project proposal for my OPW application.

Don’t believe anyone who tells you learning to code is easy…

…and don’t believe anyone who tells you that APIsespecially MediaWiki’sare intuitive.

As I gear up for WikiConference2014 next weekend, I’ll post resources I found helpful and tips for getting started yourself.