What is it used for?
Ragial Searcher is a basic parser for a website, ragial.com, which is very helpful in searching items being vended in the game, Ragnarok Online. However, ragial.com does not provide any method to notify the user of when a specific item is in sale. This Java library is written to serve that purpose. It uses the Jsoup library to parse the site, and Gson to store that data in a Json format.
How is it used?
The library has a simple set of methods to use its functions. Note that unless the "specific" api is used, RagialQueryMatcher will return an array of all items which have names similar to the supplied argument.
1) Get the RagialQueryMatcher object
RagialQueryMatcher matcher = RagialQueryMatcher.getMatcher();
2.1) Get the array of RagialData. searchRagial(name) returns a Future Object, so it is an asynchronous call. Use get() to wait until the thread finishes.
RagialData datas = matcher.searchRagial(name).get();
2.2) Get the specific RagialData. This will return only one result, however the name specified must be EXACTLY the same. Down to the spaces!
RagialData data = matcher.searchRagialSpecificly(name);
2.3) Get the specific RagialData, after already getting all similar search results as well. This will return only one result, however the name specified must be EXACTLY the same. Down to the spaces! Note this is a static method.
RagialData specificData = RagialQueryMatcher.searchRagialSpecificly(name, datas);
3.1.1) Get on sale items from a single Specific RagialData.
ArrayList<VendingNow> sales = matcher.getOnSaleItems(name, specificData).get();
3.1.2) Get on sale items from an array of RagialData. This will first obtain the specific RagialData, then find all the VendingNow items which are on sale.
3.2.1) Get on sale items from a single Specific RagialData, while searching over both the long and short range of Ragial data.
ArrayList<VendingNow> sales = matcher.getOnSaleItems(name, specificData, true).get();
4) Display the entire data
4.1) Display only the vender data
To just obtain the data and make it visible, a Jar is also included. Documentation is also available to see which classes perform which task.