// Path: src/main/java/com/syndicapp/scraper/aib/model/Account.java
// public class Account {
// 
// 	static Logger Log = Logger.getLogger(Account.class);
// 	private int id;
// 	private String name;
// 	private BigDecimal balance;
// 	private String drcr;
// 	private ArrayList<Transaction> transactions;
// 	private boolean pending;
// 
// 	public Account(int id, String name, String balance, String drcr, boolean pending) {
// 		Log.debug((new StringBuilder()).append("New Account - ").append(name).append(" - ")
// 				.append(balance).append(drcr).toString());
// 		this.id = id;
// 		this.name = name;
// 		this.balance = new BigDecimal(balance.replace(",", ""));
// 		this.drcr = (null == drcr ? "" : drcr);
// 		this.pending = pending;
// 	}
// 
// 	public String getDrcr() {
// 		return drcr;
// 	}
// 
// 	public void setDrcr(String drcr) {
// 		this.drcr = drcr;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public void setBalance(String balance) {
// 		this.balance = new BigDecimal(balance.replace(",", ""));
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public BigDecimal getBalance() {
// 		return balance;
// 	}
// 
// 	public boolean isDR() {
// 		return drcr.equalsIgnoreCase("DR");
// 	}
// 
// 
// 	public boolean isPending() {
// 		return pending;
// 	}
// 
// 	public void setTransactions(ArrayList<Transaction> t) {
// 		transactions = t;
// 	}
// 
// 	public ArrayList<Transaction> getTransactions() {
// 		return transactions;
// 	}
// 
// 	public int getId() {
// 		return id;
// 	}
// 
// 	public void setId(int id) {
// 		this.id = id;
// 	}
// 
// }


import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import com.syndicapp.scraper.aib.model.Account;
package com.syndicapp.scraper.aib;




public class PageUtils {
	private static Logger log = Logger.getLogger(PageUtils.class);
	private static String[] months = new String[] {
		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
	};
	
	/**
	 * The referer URL is the first line of the page blob (must be manually added in each page implementation)
	 * 
	 * @param page
	 * @return The Referer URL
	 */
	static public String getReferer(String page) {
		return (page.split("\n"))[0];
	}
	
	static public int getMonthFromMonthName(String name) {
		for (int i=0; i<12; i++) {
			if (months[i].equalsIgnoreCase(name)) {
				return i;
			}
		}
		return -1;
	}
	
// Path: src/main/java/com/syndicapp/scraper/aib/model/Account.java
// public class Account {
// 
// 	static Logger Log = Logger.getLogger(Account.class);
// 	private int id;
// 	private String name;
// 	private BigDecimal balance;
// 	private String drcr;
// 	private ArrayList<Transaction> transactions;
// 	private boolean pending;
// 
// 	public Account(int id, String name, String balance, String drcr, boolean pending) {
// 		Log.debug((new StringBuilder()).append("New Account - ").append(name).append(" - ")
// 				.append(balance).append(drcr).toString());
// 		this.id = id;
// 		this.name = name;
// 		this.balance = new BigDecimal(balance.replace(",", ""));
// 		this.drcr = (null == drcr ? "" : drcr);
// 		this.pending = pending;
// 	}
// 
// 	public String getDrcr() {
// 		return drcr;
// 	}
// 
// 	public void setDrcr(String drcr) {
// 		this.drcr = drcr;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public void setBalance(String balance) {
// 		this.balance = new BigDecimal(balance.replace(",", ""));
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public BigDecimal getBalance() {
// 		return balance;
// 	}
// 
// 	public boolean isDR() {
// 		return drcr.equalsIgnoreCase("DR");
// 	}
// 
// 
// 	public boolean isPending() {
// 		return pending;
// 	}
// 
// 	public void setTransactions(ArrayList<Transaction> t) {
// 		transactions = t;
// 	}
// 
// 	public ArrayList<Transaction> getTransactions() {
// 		return transactions;
// 	}
// 
// 	public int getId() {
// 		return id;
// 	}
// 
// 	public void setId(int id) {
// 		this.id = id;
// 	}
// 
// }


// Path: src/main/java/com/syndicapp/scraper/aib/PageUtils.java
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import com.syndicapp.scraper.aib.model.Account;

package com.syndicapp.scraper.aib;




public class PageUtils {
	private static Logger log = Logger.getLogger(PageUtils.class);
	private static String[] months = new String[] {
		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
	};
	
	/**
	 * The referer URL is the first line of the page blob (must be manually added in each page implementation)
	 * 
	 * @param page
	 * @return The Referer URL
	 */
	static public String getReferer(String page) {
		return (page.split("\n"))[0];
	}
	
	static public int getMonthFromMonthName(String name) {
		for (int i=0; i<12; i++) {
			if (months[i].equalsIgnoreCase(name)) {
				return i;
			}
		}
		return -1;
	}
	
    static public ArrayList<Account> parseBalances(String page) {