I have now released another Google Code Project in relation to Sabnzbd. This is a Java API that consumes Sabnzbd server functions. It supports alot of functionality at the moment, querying all information about the server and downloads and also supports other functions such as adding downloads, pausing and resuming the server.
More detail can be found on the Google Code Project here:
http://code.google.com/p/jsabnzbd/
Software Development and IT security. Mostly a place for me to keep notes. http://uk.linkedin.com/in/adamboulton
Sunday, July 4, 2010
Friday, February 19, 2010
SABnzbd Java API
For all you SABnzbd fans, i've got a real treat for you. I've just put together a Java API (must admit didn't take long) to support various functions that SABnzbd supports. Here is a sneak preview of what you will be able to do with 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());
}
}
Tuesday, January 26, 2010
Orange SMS API
So you own an account with Orange and you want to have the ability to send SMS using your Orange credit which you have already paid for on your monthly contract? Well I certainly did, and the API works identically to the T-Mobile API which I developed. So here is an example of how you would use my Java API to send an SMS through the Orange network:
I have found this particularly useful as it has allowed me to load balance the sending of SMS through either the T-Mobile or Orange network. Due to both of the classes which now implement the "MobileNetwork" interface means you can program to the interface not the implementation. Now being able to utilise two separate GSM networks also improves the stability of all the applications I develop which require SMS communication. Please feel free to contact me via email if you feel this is something of interest to you.
Orange orange= new Orange("username", "password");
orange.sendSMS("01234567890", "Hello World!");
I have found this particularly useful as it has allowed me to load balance the sending of SMS through either the T-Mobile or Orange network. Due to both of the classes which now implement the "MobileNetwork" interface means you can program to the interface not the implementation. Now being able to utilise two separate GSM networks also improves the stability of all the applications I develop which require SMS communication. Please feel free to contact me via email if you feel this is something of interest to you.
Tuesday, January 12, 2010
Netbeans IDE not loading...
For all the Netbeans fans out there (I am certainly one of them) you may have come across at some point that Netbeans will not load after the loading of modules and you may end up with a blank screen or just a basic outline of the Netbeans window. After doing some debugging to find out what is going on the best solution I have found is to delete the Netbeans cache. You can find out where your cache is stored by looking inside your Netbeans conf file and you will see an entry similar to:
So for most Windows based users you will probably find your cache directory here:
Simply remove the ".netbeans" directory (ensure Netbeans is not loaded) and you should be good to reload. Note though that you will lose configurations, for example you won't have any projects listed when you next load, also any custom services won't be listed like databases of web servers. I have found it is quick enough to put it all back in and you should be up and running again within a few minutes.
# ${HOME} will be replaced by JVM user.home system property
netbeans_default_userdir="${HOME}/.netbeans/6.7"
So for most Windows based users you will probably find your cache directory here:
C:\Documents and Settings\<USERNAME>\.netbeans
Simply remove the ".netbeans" directory (ensure Netbeans is not loaded) and you should be good to reload. Note though that you will lose configurations, for example you won't have any projects listed when you next load, also any custom services won't be listed like databases of web servers. I have found it is quick enough to put it all back in and you should be up and running again within a few minutes.
Saturday, January 9, 2010
Java Weather API
Knowing what is happening with the weather is always a piece of useful information worth having. After Googling around I wasn't able to find an actually Java API for the weather and I could see many others were just looking for a simple Java API to plug into their system. So I started the development with a friend, Luke Morgan, and we are at the stages where the API has reached a mature level and is something we will release shortly, most likely as part of a Google Code project. The API is extremely easy to use (as it should be!) and here is an example of how it would be utilised:
So as you can see, incorporating this API into any application is trivial. The API also supports the forecast for weather. So, for example, it could be successfully utilised as:
This is something I have personally utilised as part of Jarvis - the virtual assistant. By utilising this API in my system I receive weather updates automatically each morning, giving me the current condition and forecast data then receiving another update at night giving me tomorrows forecast. The updates are mostly delivered using my T-Mobile API. It is further utilised by the fact that Jarvis has access to my Google Calendar, so for each event Jarvis also delivers the weather conditions.
In the meantime if you would like access to this code please feel free to contact me.
Weather weather;
try
{
Weather weather = WeatherStation.getWeather("wirral");
}
catch(WeatherStationException wse)
{}
weather.getConditions(); //Returns a string, such as "Fog", "Partly Cloudy"
weather.getTemperature(); //returned in degree celsius
So as you can see, incorporating this API into any application is trivial. The API also supports the forecast for weather. So, for example, it could be successfully utilised as:
Forecast forecast;
try
{
forecast = WeatherStation.getForecast("wirral");
}
catch(WeatherStationException wse
{}
for(Weather weather: forecast.getForecast()) //returns a list of Weather (4 days)
{
System.out.println(weather.getDate() + " is forecast for " + weather.getConditions());
}
}
This is something I have personally utilised as part of Jarvis - the virtual assistant. By utilising this API in my system I receive weather updates automatically each morning, giving me the current condition and forecast data then receiving another update at night giving me tomorrows forecast. The updates are mostly delivered using my T-Mobile API. It is further utilised by the fact that Jarvis has access to my Google Calendar, so for each event Jarvis also delivers the weather conditions.
In the meantime if you would like access to this code please feel free to contact me.
Jarvis - The Virtual Assistant
I have been busy writing alot of Java APIs lately, specifically for plugging into an virtual assistant that I am constructing, called Jarvis. The concept behind Jarvis is that of any assistant, it is a tool who or that helps another person accomplish his goals but the beauty of a virtual assistant is one that never sleeps and they don't take a salary. Communication is always a key to successful assistants and I have accomplished this by developing a modularised communication system which utilises email, SMS and chat rooms. For example, Jarvis is currently able to communicate via email, SMS and Google Talk. Commands can be issued via any of those methods and Jarvis responds via the appropriate medium based upon my status and using some seamless intelligence. For example, if I issue a command such as "define assistant" via SMS and the definition is over 160 characters the communication control centre will find a more appropriate medium to deliver the response, for example if I am logged into Google Talk then Jarvis responds via that channel.
I have been making good progress on this project over the past months, currently offloading tasks such as bank account checks (the jHSBC API mentioned below has been plugged into the Jarvis system and I receive alerts about bank account changes), and Jarvis is also plugged into my Google Calendar allowing the system to send updates via SMS to myself but also any other relevant parties who are attached to that event.
Designing Jarvis has prompted me to develop many APIs in order for the system to perform a wide range of tasks. The capabilities of Jarvis so far continue to extend, most recently I have developed a Java API for Weather and an API for mapping journeys. I will be releasing more information on these APIs shortly.
I have been making good progress on this project over the past months, currently offloading tasks such as bank account checks (the jHSBC API mentioned below has been plugged into the Jarvis system and I receive alerts about bank account changes), and Jarvis is also plugged into my Google Calendar allowing the system to send updates via SMS to myself but also any other relevant parties who are attached to that event.
Designing Jarvis has prompted me to develop many APIs in order for the system to perform a wide range of tasks. The capabilities of Jarvis so far continue to extend, most recently I have developed a Java API for Weather and an API for mapping journeys. I will be releasing more information on these APIs shortly.
Thursday, July 30, 2009
T-Mobile API
I currently have a mobile account with T-Mobile, who give me a generous £200 worth of credit each month for £20. It is actually quite difficult to take advantage of all the credit, I usually only utilise about £100 a month of it. So I decided to take advantage of it by writing a Java API for accessing and using certain features of my T-Mobile account. I have been using my T-Mobile API in my software, such as the HSBC bot to deliver updates to myself. Using my T-Mobile API is extremely easy, here is a taster.....
In order to use this API you must have an account with T-Mobile (http://www.t-mobile.co.uk) and the ability to send web texts from your account. This API is reliable and stable. It is ideal for utilising it for desktop and web applications. If you would like access to this codebase please contact me via email.
TMobile tmobile = new TMobile("username", "password");
tmobile.sendSMS("01234567890", "Hello World!");
In order to use this API you must have an account with T-Mobile (http://www.t-mobile.co.uk) and the ability to send web texts from your account. This API is reliable and stable. It is ideal for utilising it for desktop and web applications. If you would like access to this codebase please contact me via email.
Sunday, July 12, 2009
Windows Storage Server 2008
Yesterday I replaced my FreeNAS with Windows Storage Server 2008. While FreeNAS is a great piece of software I finally realised it just wasn't for me, mainly because I am more comfortable within a Windows environment but there were some fairly big issues such as:
1. No JVM (You would have to install Diablo on FreeNAS if you wanted one and I like to stick with Sun's JVM). I do alot of Java development and really want to customise my Storage server with custom tools.
2. Bit Torrent client - Transmission is the default client and it seemed to prove a headache for many if wanting to update it. Most people just waited for the FreeNAS update which usually ships with the latest version. I wanted uTorrent back as it is by far the most lightweight, feature packed and fastest BT client I have ever used. Tranmission would only give me download speeds of around 3.5MBps but uTorrent is able to max my line at 6MBps.
Oh, and one more thing, I was quite surprised when I first booted Windows Storage Server 2008 to see that if was prompting me for credentials when I have never supplied any. The default password is "wSS2008!"
1. No JVM (You would have to install Diablo on FreeNAS if you wanted one and I like to stick with Sun's JVM). I do alot of Java development and really want to customise my Storage server with custom tools.
2. Bit Torrent client - Transmission is the default client and it seemed to prove a headache for many if wanting to update it. Most people just waited for the FreeNAS update which usually ships with the latest version. I wanted uTorrent back as it is by far the most lightweight, feature packed and fastest BT client I have ever used. Tranmission would only give me download speeds of around 3.5MBps but uTorrent is able to max my line at 6MBps.
Oh, and one more thing, I was quite surprised when I first booted Windows Storage Server 2008 to see that if was prompting me for credentials when I have never supplied any. The default password is "wSS2008!"
Tuesday, June 30, 2009
Adam Boulton's Java HSBC API - No, not the payment gateway!
So, I have finally got round to setting up the HSBC Java API (some of you may remember my posts from months back mentioning my personal project I was working on HSBC Bank account aggregation). Writing this API has been a personal project of mine which has been on and off for a while now due to other committments. The idea behind this API is that it easily allows you to access your UK HSBC accounts and transaction history. I have so far found it useful for tracking my expenditure (by grouping transactions) and using it for notifications about the most recent transaction to be processed on my account. I am sure many developers will find this project interesting and will find many interesting ways to incorporate it into their applications.
Java PDF Library
I have been playing around with extracting data from PDF files. Apache PDF Box looked pretty promising but unfortunately it is far behind some of the others that are available. iText is a mature library but lacks the ability to extract information (it is actually a PDF creator). I was very impressed by the work done by LAB Asprise!. It took minutes to understand their impressive API and start coding. The parsing is fast, and so far appears accurate. The library is also extremely small for the abilities it provides (just over 3MB). If you are looking for a powerful Java API for processing PDFs then I strongly recommend it. Here is a code sample for extracting text (taken from their site). The code clearly demonstrates how much of an awesome job these guys have done....
PDFReader reader = new PDFReader(new File("my.pdf"));
reader.open(); // open the file.
int pages = reader.getNumberOfPages();
for(int i=0; i < pages; i++)
{
String text = reader.extractTextFromPage(i);
System.out.println("Page " + i + ": " + text);
}
Subscribe to:
Posts (Atom)