Page 1 of 1

SABnzbd Java API

Posted: February 20th, 2010, 9:46 am
by adam
HI guys, started using SABnzbd a couple of weeks back, fantastic work guys. I have started development of a Java API (I believe one does not exist?). For more information please visit my blog for now: http://aboulton.blogspot.com/2010/02/sa ... a-api.html

Currently got a few mates doing some tests and I will be releasing it soon. I hope some of you will find this useful. Here is my "hello world" example of utilising the API:

String[] nzbs =
{"http://www.newzbin.com/browse/post/5569239/nzb",
"http://www.newzbin.com/browse/post/5568352/nzb"};

String sabURL= "http://sabserverurl";
SABnzbd mySabServer= new SABnzbd(sabURL, "uname", "pwd");

System.out.println("Current download speed: " + mySabServer.getDownloadSpeed());

for(String nzb: nzbs)
{
mySabServer.download(nzb);
}

List queue = mySabServer.getQueue();

if (queue.isEmpty()) {
  System.out.println("No download entries");
} else {
  for (QueueEntry qu : queue) {
    System.out.println("---- New Entry --- ");
    System.out.println("Category: " + qu.getCategory());
    System.out.println("Name: " + qu.getName());
    System.out.println("Reamining " + qu.getRemain());
    System.out.println("Total:" + qu.getTotal());
    System.out.println("ETA: " + qu.getEta());
  }
}


Also, I am considering putting together a client together for the BlackBerry, would people find this useful?

Cheers and keep up the great work guys!


Adam

Re: SABnzbd Java API

Posted: February 20th, 2010, 10:14 am
by adam
adam wrote: HI guys, started using SABnzbd a couple of weeks back, fantastic work guys. I have started development of a Java API (I believe one does not exist?). For more information please visit my blog for now: http://aboulton.blogspot.com/2010/02/sa ... a-api.html

Currently got a few mates doing some tests and I will be releasing it soon. I hope some of you will find this useful. Here is my "hello world" example of utilising the API:
String[] nzbs =
{"http://www.newzbin.com/browse/post/5569239/nzb",
"http://www.newzbin.com/browse/post/5568352/nzb"};

String sabURL= "http://sabserverurl";
SABnzbd mySabServer= new SABnzbd(sabURL, "uname", "pwd");

System.out.println("Current download speed: " + mySabServer.getDownloadSpeed());

for(String nzb: nzbs)
{
mySabServer.download(nzb);
}

List queue = mySabServer.getQueue();

if (queue.isEmpty()) {
  System.out.println("No download entries");
} else {
  for (QueueEntry qu : queue) {
    System.out.println("---- New Entry --- ");
    System.out.println("Category: " + qu.getCategory());
    System.out.println("Name: " + qu.getName());
    System.out.println("Reamining " + qu.getRemain());
    System.out.println("Total:" + qu.getTotal());
    System.out.println("ETA: " + qu.getEta());
  }
}
Also, I am considering putting together a client together for the BlackBerry, would people find this useful?

Cheers and keep up the great work guys!


Adam

Re: SABnzbd Java API

Posted: May 5th, 2010, 6:59 am
by bdawg
Hi Adam,

I'm a BlackBerry fanatic, and would love a BB client for SABnzbd!

I work in the messaging space, and spend a lot of time with BES solutions. I am happy to test any applications that you may have, though I am not a developer so I can't really help out too much in that area.

Let me know if you need me to test anything and I'd be happy to do so :)

Re: SABnzbd Java API

Posted: July 4th, 2010, 8:34 am
by adam
Hi,

In regards to the Java Sabnzbd API there is now a Google Code project page that I have setup. The API is extremely easy to use. You can find more details about this project here:

http://code.google.com/p/jsabnzbd/

I have started development for the BlackBerry client and hopefully should have something decent by the end of the month (July 2010).

Cheers and I look forward to any feedback in regards to the Java API.

Re: SABnzbd Java API

Posted: July 14th, 2010, 6:32 am
by jonneymendoza
eh? why would you need a java api to use this server? whats wrong with using the sab's own API like the rest of us? im working on a android java app and im doing fine using SAB's api.

not trying to sound rude but trying to understand why you need a SAB java api

Re: SABnzbd Java API

Posted: July 14th, 2010, 8:44 am
by adam
Hi,

"whats wrong with using the sab's own API like the rest of us?"

There is nothing wrong with the SAB API, it is well designed and developed.

"why would you need a java api to use this server?"

The reason I fitted a Java API around the SAB API (which is just GET requests) is that it easily allows for me to utilise more of Java technologies, such as utilising this in applets, RMI and providing a simplified use of serialising the data. Not only that, if offers more support for validation and error handling.

If anyone is using the SAB API in a Java based application (or any other language) you will have to manage the HTTP requests and parsing of the XML feeds, just like my API does internally. So, to help improve development times and re-usability I offered up my Java API. As you can see from the sample code on the Google project page it is extremely easy to use.

As a Developer, you will understand that when coding you strive to develop an API (if you don't use OO languages I appreciate this may be difficult to grasp). I have also written the API for the BlackBerry platform, as it makes sense to do so.

Kind regards

Adam

Re: SABnzbd Java API

Posted: January 5th, 2011, 5:51 pm
by CranialBlaze
How does one use this, i have a blackberry and it does not recognize the jar as in installable file

Re: SABnzbd Java API

Posted: January 6th, 2011, 2:38 am
by atnguyen001
String[] nzbs =
{"http://www.newzbin.com/browse/post/5569239/nzb",
"http://www.newzbin.com/browse/post/5568352/nzb"};

String sabURL= "http://sabserverurl";
SABnzbd mySabServer= new SABnzbd(sabURL, "uname", "pwd");

System.out.println("Current download speed: " + mySabServer.getDownloadSpeed());

for(String nzb: nzbs)
{
mySabServer.download(nzb);
}

List queue = mySabServer.getQueue();

if (queue.isEmpty()) {
  System.out.println("No download entries");
} else {
  for (QueueEntry qu : queue) {
    System.out.println("---- New Entry --- ");
    System.out.println("Category: " + qu.getCategory());
    System.out.println("Name: " + qu.getName());
    System.out.println("Reamining " + qu.getRemain());
    System.out.println("Total:" + qu.getTotal());
    System.out.println("ETA: " + qu.getEta());
  }
}

Nice ,thanks.
I'm using BB, this is very useful