Archives for posts with tag: opw

For the last part of my internship, I’m adding a search function to the Java Wiki Bot Framework. Unfortunately, the Java ecosystem has had other ideas. JWBF uses Maven, a common build automator and dependency manager, and I’ve had a difficult time getting it working on my own system. (I wrote about the things I tried here.)

Partly because of the frustration of getting such a simple program up and running and partly because it’s been a decade since I used anything besides a scripting language, I’ve had a hard time getting myself to work on the project itself. Tonight I jumped into the Java method problems at Coding Bat. It’s all online so there’s no need to struggle with classpaths or system-specific differences. I’ve been enjoying it, kind of like I enjoy working math where I know the steps, or enjoy balancing redox equations.

Note to self: doing little bits of code practice is kind of like washing up the glassware you know you’ll need so you can just get started on the next reaction whenever the one running decides it’s done. Gather ye momentum where ye may.

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.

Since I’ve reached the part of my internship where I need to evaluate a Ruby web API client library and had never written Ruby, I went looking for places to learn! Some of these are books, some are websites, some are web tutorials. All are online and free. If you’re new to Ruby, give these a shot!


Ruby Best Practices:
Previously available for free at The author is now working on Practicing Ruby:
Interesting links from Practicing Ruby: and .

Programming Ruby: The Pragmatic Programmer’s Guide:
When people talk about “pickaxe book” this is the one they’re talking about! This version is fairly dated:
“This book documents Version 1.6 of Ruby, which was released in September 2000.”

Why’s (Poignant) Guide To Ruby:
If you want an off-the-wall introduction to Ruby, this one has cartoon foxes.

Mr. Neighborly’s Humble Little Ruby Book:

Learn Ruby The Hard Way:

Web-based tutorials:

Ruby Koans:
Make things work! Also downloadable.

Try Ruby:
More in-browser Ruby tutorials.

Codeacademy’s Ruby module:
Interactive web-based Ruby lessons.

Adorable game where you write Ruby code to move your warrior and defeat enemies.

A MIT OpenCourseWare handout that has a no-frills guide to some basics and talks about differences between Ruby and Python:

Ruby Style Guide: . I’ve been told that this is as close as the Ruby community gets to consensus on what “good Ruby” looks like.

command line ruby cheat sheets:

Ruby Cookbook is not freely available, but the all the code from the book is:

Ruby is definitely not what I am used to, but it seems like an interesting language and I’m looking forward to learning more of it when I have more time.

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.