Users of bitlyj,
This weekend I resumed work on bitlyj, (re)writing it with a much
simpler, better, usage-driven design. I apologize for allowing it to
stagnate for so long, and I hope you give 2.0 a try. When you do, I
feel certain you will agree that its API is not only much nicer, but
the library as a whole simply better.
* Error handling. With bitlyj 1, one of the most common complaints was
cryptic error messages, usually in the form of json-lib parsing
errors. With bitlyj 2, this has been rectified. If an I/O error
occurs, it is noted in the exception. If a parsing error occurs, it is
noted with a specific message. If bitly responds with an error code,
the code and its message are used in the exception. If the response
can't be understood for some reason, that is specifically noted as
well. Further, there are no checked exceptions. Any such exception is
dealt with internally and wrapped/re-thrown as an unchecked exception
(BitlyException is unchecked).
* Zero dependencies. The last version required json-lib to consume the
json output of bitly. It could have been a different library, but xml
was simply not an option because of a long-standing problem in how
bitly generated xml. The xml was invalid, and so most parsers would
fail. I opened the original ticket (
http://code.google.com/p/bitly-api/
issues/detail?id=2), which idled a month short of a year before being
addressed. Finally, when bitly released v3, the problem was addressed.
* Super-easy to use. Refer to the QuickStart (
http://code.google.com/p/
bitlyj/wiki/QuickStart) for more details, but the essence of
interaction is this:
as("bitlyapidemo",
"R_0da49e0a9118ff35f52f629d2d71bf07").call(shorten("http://
rosaloves.com/"));
* Extensibility. The original design of bitlyj defined a monolithic
java interface with methods bound to those exposed by bitly. If a new
method was introduced or deprecated, there was no way to reflect this
without releasing an updated version of the library. bitlyj 2.0 with a
simple command-style interface, so rolling new methods or your own
versions of existing ones is cake. Bitly-powered endpoints other than
bit.ly and
j.mp are also easy to interface with.
I also intend to fully support android. bitlyj 2 may already support
android, but I haven't tested it yet.
bitlyj 2 is available now - I'll call it beta. It has a comprehensive
test suite, but I want more real usage, and more importantly, I want
to know if it suits your needs. If something is missing, working
poorly, or not at all, I will address it.
Start using it now as a maven snapshot, or just grab the jar from the
project site. The snapshot is available on the sonatype oss snapshot
repository (
https://oss.sonatype.org/content/repositories/snapshots/):
<dependency>
<groupId>com.rosaloves</groupId>
<artifactId>bitlyj</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
Thanks for your input!
-chris