Skip to content
Browse files

Add doc and sample

  • Loading branch information...
1 parent d0713ec commit 78876ab9bfb4311fc83dc9f3e78f1597915a546a @chamerling committed
View
14 README.blog.markdown
@@ -0,0 +1,14 @@
+#JavaGrowl
+Here is a really simple library to send notifications to [Growl](http://growl.info) from any Java program.
+
+This implementation is originally based on the Growl Jenkins plugin and uses the network feature provided by Growl to publish notifications.
+
+##Configure
+Under OS X preferences, go to the Growl options and then activate the network feature. Set a passwork in the server password text field if necessary. This password will be required in the Java code.
+
+<img src="http://f.cl.ly/items/1j0G1a2S3G2e1n1p0m2N/growl-network.png"/>
+
+##Code
+Using JavaGrowl is quite simple, once you have activated the network feature in Growl, you can use it like this:
+
+<script src="https://gist.github.com/1178562.js?file=Main.java"></script>
View
5 src/main/java/org/chamerling/javagrowl/GrowlNetwork.java
@@ -169,9 +169,4 @@ public static GrowlNetwork register(String appName, String password,
g.doRegistration(appName, password);
return g;
}
-
- public static void main(String[] args) {
- Growl g = GrowlNetwork.register("JavaGrowlApp", "YOURPASSWORD");
- g.notify("JavaGrowlApp", "The title", "This is the notification message...", "YOURPASSWORD");
- }
}
View
20 src/test/java/org/chamerling/javagrowl/app/Main.java
@@ -0,0 +1,20 @@
+/**
+ *
+ */
+package org.chamerling.javagrowl.app;
+
+import org.chamerling.javagrowl.Growl;
+import org.chamerling.javagrowl.GrowlNetwork;
+
+/**
+ * @author chamerling
+ *
+ */
+public class Main {
+
+ public static void main(String[] args) {
+ // will register only if needed but returns a Growl instance in all cases...
+ Growl g = GrowlNetwork.register("JavaGrowlApp", "YOURPASSWORD");
+ g.notify("JavaGrowlApp", "The title", "This is the notification message...", "YOURPASSWORD");
+ }
+}

0 comments on commit 78876ab

Please sign in to comment.
Something went wrong with that request. Please try again.