chrislewis's posterous

I am a software developer, perpetual student, and prudent observer. I am fascinated by technology, aesthetics, language, and by humanity.

bitlyj 2.0 Available

Bitlyj 2.0 is out and available through maven central or direct download. For a more detailed overview, see the QuickStart page, but here's a teaser. Assuming the imports:

import com.rosaloves.bitlyj.*;
import static com.rosaloves.bitlyj.Bitly.*;

and credentials:

String user = "user";
String apiKey = "R_XXXXX";

you shorten a URL like this:

as(user, apiKey).call(shorten("http://rosaloves.com/"));

Noteworthy features, as they appear on the project page:

  • Concise DSL syntax with obvious semantics == bitly interaction with no boilerplate.
  • Natural error handling with no checked exceptions. If you want to deal with exceptions, catch BitlyException and access the delivered message (yields bitly's status text).
  • J.mp support baked in, with the same DSL sugar.
  • Runs on Android.
  • Zero dependencies.
  • Flexible API. Bitly methods are no longer hard-wired to an interface, so evolution is possible without API breakage.
  • Extensible API. Implementing your own methods is simple: implement the functionality in an implementation of BitlyMethod?. You get core error handling for free, and you can even implement specialized methods not supported by bitly.
  • Access to other bitly-powered services is simple: implement Provider (two methods).

The library is well-tested, but you run into a problem open an issue (or post to the list).

bitlyj 2.0 (beta) Available

bitlyj 2.0 is ready for public testing. I'll stop flooding my blog with such announcements, and refer interested parties to the google group. Have a look at my inaugural post for an idea of the direction (which you can and should help mold).

bitlyj 2.0 in Trunk

Ok, so first off I apologize for not following through with a bitlyj 1.1.0 release. I couldn't find the time or motivation, so I let it slide. I had planned to replace bitlyj entirely with a lighter library in Scala, but then accepted that there many users who probably can't (or don't want to) have that as a dependency. Therefore, even though I'm a post-java type, I've gone ahead and started working on bitlyj 2.0. This is a simpler rewrite of 1.0, with an approach to extensibility that doesn't make many assumptions about the future of bitly (unlike 1.0). It also makes an effort to be even more expressive than 1.0, with more attention paid to a DSL-like interaction. The 2.0 api is semi-stable and available in trunk, as well as a jar on the project site. I will get snapshots up soon. Use it and give feedback!

bitlyj 1.0 and bit.ly v3

Last Tuesday, bit.ly announced version 3 of the API to their URL shortening service. Version 3 is structurally similar to 2, however the endpoints are now versioned as part of the path instead of a query parameter. In addition, the available methods have been changed.

The 1.0 release of bitlyj will completely break when the 2.0.1 endpoint is removed. Jehiah Czebotar, the gatekeeper of the API, has vaguely implied that this might happen in a few months.

On the bright side, it seems many issues have been addressed, including the two I opened (2, and 3).

My plans for bitlyj are to release a quick 1.1.0 version, which will preserve the existing API as much as possible (the info call is no longer available), as well as add a call or two (expand short url). Expect a preliminary release within a week or two. After that I will focus new development on a simpler library written in scala and powered by dispatch - full compatibility with java intact.

bitlyj: 1.0

UPDATE: Stable artifacts are now available on maven central! Thanks to Sonatype for providing free artifact hosting service for open source projects. For your mavenized open source project, I recommend it.

 

I've released bitlyj as 1.0 stable. If you need to shorten URLs from java using bit.ly (or j.mp), get it here. On a related note, if anyone has gone through the hoops of publishing maven artifacts to maven central, drop me a line.

A Java Interface to the Bit.ly API

I’ve just pushed some alpha code to a google code project site, implementing a Java interface to the bit.ly URL shortening service API. There’s still a bit to do in the way of negative testing and data access for the /info and /stats calls, but it’s a start. Give it a hack if you’re so inclined: http://code.google.com/p/bitlyj/.