GroovyRTM

Java/Groovy API library for Remember The Milk

License

License

Categories

Categories

Groovy Languages
GroupId

GroupId

com.eriwen
ArtifactId

ArtifactId

groovyrtm
Last Version

Last Version

2.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

GroovyRTM
Java/Groovy API library for Remember The Milk
Source Code Management

Source Code Management

https://github.com/eriwen/groovyrtm

Download groovyrtm

How to add to project

<!-- https://jarcasting.com/artifacts/com.eriwen/groovyrtm/ -->
<dependency>
    <groupId>com.eriwen</groupId>
    <artifactId>groovyrtm</artifactId>
    <version>2.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.eriwen/groovyrtm/
implementation 'com.eriwen:groovyrtm:2.1.2'
// https://jarcasting.com/artifacts/com.eriwen/groovyrtm/
implementation ("com.eriwen:groovyrtm:2.1.2")
'com.eriwen:groovyrtm:jar:2.1.2'
<dependency org="com.eriwen" name="groovyrtm" rev="2.1.2">
  <artifact name="groovyrtm" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.eriwen', module='groovyrtm', version='2.1.2')
)
libraryDependencies += "com.eriwen" % "groovyrtm" % "2.1.2"
[com.eriwen/groovyrtm "2.1.2"]

Dependencies

compile (1)

Group / Artifact Type Version
commons-codec : commons-codec jar 1.6

test (2)

Group / Artifact Type Version
junit : junit jar 4.10
org.gmock : gmock jar 0.8.2

Project Modules

There are no modules declared in this project.

Groovy Remember The Milk! Build Status

GroovyRTM allows you to easily take advantage of the Remember The Milk REST API using any language on the JVM. In short, you can now write apps for Remember The Milk without having to worry about all the HTTP transaction stuff, error handling, etc. As its name implies, it's written in Groovy, which made it much easier to write and test.

Getting Started:

You need 2 things to create a app using GroovyRTM:

Gradle/Grails build config

compile 'com.eriwen:groovyrtm:2.1.2'

Maven config

<dependency>
    <groupId>com.eriwen</groupId>
    <artifactId>groovyrtm</artifactId>
    <version>2.1.2</version>
</dependency>

Simple Example Java Application:

import org.eriwen.rtm.*;
class MyGroovyRtmTest {
    public static void main(String[] args) {
        GroovyRtm groovyrtm = new GroovyRtm("<api key>","<shared secret>");
        groovyrtm.testEcho();
    }
}

Authentication Example:

package groovyrtmauth;
import java.awt.Desktop;
import java.io.IOException;
import java.net.*;
import org.eriwen.rtm.*;
public class MyGroovyRtmTest {
   public static void main(String[] args) {
       GroovyRtm rtm = new GroovyRtm("myapikey", "mysharedsecret");
       try {
           if (!rtm.isAuthenticated()) {
               // Start login process by getting the authorization URL
               try {
                   String authUrl = rtm.getAuthUrl();
                   if (Desktop.isDesktopSupported()) {
                       // Open the auth web page
                       Desktop desktop = Desktop.getDesktop();
                       desktop.browse(new URI(authUrl));
                       System.out.println("I've just opened a web page so you can authorize Groovy RTM");
                   } else {
                       System.out.println("Please open " + authUrl + " in a web browser to authorize Groovy RTM");
                   }
                   System.out.println("Press any key when done...");
                   //TODO: Put your application logic or button here so users can click a button when done
                   System.in.read();
                   // GroovyRTM automatically stores the auth token
                   String authToken = rtm.authGetToken();
                   if (authToken != null) {
                       // We're golden!
                       System.out.println("Groovy RTM successfully authorized!!");
                   }
               } catch (URISyntaxException ue) {
                   ue.printStackTrace();
               } catch (IOException ioe) {
                   ioe.printStackTrace();
               }
           } else {
               System.out.println("Groovy RTM already authorized!");
           }
       } catch (GroovyRtmException rse) {
           rse.printStackTrace();
       }
   }
}

Quick-start Project:

Download a NetBeans project setup with the latest GroovyRTM JAR and optimal project structure here. Project also includes RTM authorization code to help you start even faster!

Contributing

When submitting patches, please include comments when code is not obvious and include thorough tests.

Statistics, note the avg. complexity: [[http://static.eriwen.com/images/groovyrtm_stats.png]]

Clover code coverage: [[http://static.eriwen.com/images/groovyrtm_coverage.png]]

Versions

Version
2.1.2
2.1.1