JAM
Contents |
[edit] What is jam?
Jam is the java command line tool which is the client version of the Unified Ebook Search Engine project by Gianfranco Alongi.
[edit] Installation
Jam does not need to be installed, it is run by the java virtual machine directly on the host. All you need to to is to download the latest jam zip. It is currently hosted by Gianfranco, but will soon be hosted by Witsbits.com Witsbits.com once everything is set up.
The file size is approximately 2MB.
[edit] Using Jam
To be able to use jam, you will need to have a java virtual machine (which is the same as a java runtime environment)
Please note that if you have java version 5 (JRE 5) and not the latest JRE (java 6), then you will have to download jam_JRE5.zip and not jam.zip, that is, simply change 'jam.zip' (seen below) to 'jam_JRE5.zip'
- Download the jam zip file from here http://www.alongi.se/unifiedsearchengine/jam.zip
- Unpack the zip file jam.zip into a folder (place does not matter for now)
- Run the client with the command java -jar jam.jar (this should output the text seen in the image below)
You may now search using several parameters. (most of them will be expanded to accept more values, for example the format parameter).
If you are using linux, it can be very handy to define an alias for running jam. A short example could be alias jam='java -jar jam.jar'
thus you would only need to type jam to run the client (if you are in the directory where the client is, otherwise simply set the alias
to the absolute path of the jam.jar file). Just to be explicit, all examples show the full way of running jam.
Searching for an ebook can be done by combining several of the possible parameter title, author, format, keywords and isbn, the examples below show how to use each one separately.
- title (note that you must quote the title).
example: java -jar jam.jar --title "Interesting Times" example: java -jar jam.jar --title "The thief of time"
- author(note that you must quote the author).
example: java -jar jam.jar --author "Terry Pratchett" example: java -jar jam.jar --author "Isaac Asimov"
- format (note that this is a quoted list which is either only any or a space separated list of the possible formats; see the image)
example: java -jar jam.jar --format "any" example: java -jar jam.jar --format "PDF EPUB MOBIPOCKET"
- keywords (note that this is quoted comma separated list)
example: java -jar jam.jar --keywords "magic,mayhem" example: java -jar jam.jar --keywords "robotics, sapient"
- isbn
example: java -jar jam.jar --isbn 978-0521813976 example: java -jar jam.jar --isbn 0521813972
as I said previously, these parameters can be combined
example: java -jar jam.jar --keywords "machine,learning,kernel" --format "MOBIPOCKET"
the output format of the search result can be controlled by the flags encode, sortby and output, these flags (in order) affect the format in which the result is output, the order of each eBook found and if the output is sent to stdout or to a file (you can of course always redirect the stream with '>' and '>>').
- encode (note that the current version only supports 'raw' and 'html', the default value is 'raw')
example: java -jar jam.jar --author "Terry Pratchett" --encode html example: java -jar jam.jar --author "Terry Pratchett" --encode raw example: java -jar jam.jar --author "Terry Pratchett" --encode latex
- sortby (default value is 'format')
example: java -jar jam.jar --author "Terry Pratchett" --sortby publisher --encode html example: java -jar jam.jar --author "Terry Pratchett" --sortby title example: java -jar jam.jar --author "Terry Pratchett" --sortby price
- output (default value is 'stdout')
example: java -jar jam.jar --author "Terry Pratchett" --output thefilenamedlikethis example: java -jar jam.jar --author "Terry Pratchett" --output stdout example: java -jar jam.jar --author "Terry Pratchett"
[edit] Some quick examples (for the hasty)
- This example will search for the title "Interesting times" by Terry Pratchett, sort the results by price (lowest first) and output the result as a html page (which you may open with your browser). Those suppliers which abide completely by the API specification will also send a link to the book.
java -jar jam.jar --title "Interesting times" --format "EPUB" --sortby price --encode html > output.html
- This example will search for all titles by any author named "Isaac", sort the results by price (lowest first) and output the result to a html page named results.html (which you may open with your browser). Those suppliers which abide completely by the API specification will also send a link to the book.
java -jar jam.jar --author "Isaac" --format "any" --sortby price --encode html --output results.html
[edit] Latest version (v 1.2)
The latest version is v 1.2 and it's available for both JRE 5 and JRE 6 users. The great change from v 1.1 is that 1.2 has a --gui switch option. The main purpose of the --gui option is to present the user with input fields and dropdown boxes. Using --gui is quite intuitive. Leaving a field blank simply ignores it when the query is generated.
[edit] Important to know
The current version discriminates on suppliers abiding the API or not. All suppliers which DO NOT abide by the API specification 100% are always put on the bottom of the hit list. This gives the effect of always showing the abiding suppliers at the top of the page when outputting as HTML. This is implemented in version 1.1 and later. Check if your version is 1.1 by using the --version flag. If you do not have the latest, download it!