// Path: Webkiosk/src/main/java/com/blackMonster/webkiosk/utils/M.java
// public class M {
// 	private static final boolean showLog = true;
// 	public static void log(String TAG, String text) {
// 		if (showLog) Log.d(TAG, text);
// 
// 	/*	File logFile = new File("sdcard/log.txt");
// 		if (!logFile.exists()) {
// 			try {
// 				logFile.createNewFile();
// 			} catch (IOException e) {
// 				e.printStackTrace();
// 			}
// 		}
// 		try {
// 			// BufferedWriter for performance, true to set append to file flag
// 			BufferedWriter buf = new BufferedWriter(new FileWriter(logFile,
// 					true));
// 			String mydate = java.text.DateFormat.getDateTimeInstance().format(Calendar.getInstance().getTime());
// 			buf.append(mydate + "     " + TAG + " --->  " + text);
// 			Log.d(TAG, text);
// 			buf.newLine();
// 			buf.close();
// 		} catch (IOException e) {
// 			e.printStackTrace();
// 		}*/
// 	}
// }
// 
// Path: Webkiosk/src/main/java/com/blackMonster/webkiosk/crawler/Model/CrawlerSubjectInfo.java
// public class CrawlerSubjectInfo extends SubjectAttendance {
// 
//     private String link;
// 
//     public String getLink() {
//         return link;
//     }
// 
//     public void setLink(String link) {
// 
//         if (link == null || link.equals(""))
//             link = null;
// 
//         this.link = link;
//     }
// }


import com.blackMonster.webkiosk.utils.M;
import com.blackMonster.webkiosk.crawler.Model.CrawlerSubjectInfo;
import java.util.ArrayList;
import java.util.List;
import cz.msebera.android.httpclient.client.HttpClient;
		while (true) {
			tmp = reader.readLine();
			if (tmp == null)
				throw new BadHtmlSourceException();

			if (tmp.contains("</tbody>"))
				break;

			if (tmp.contains("<tr>")) {
				readRow(list);
			}
		}

	}
	@Override
	String getMainUrl() {
		return WebkioskWebsite.getSiteUrl(colg) + "/StudentFiles/Academic/PRStudentView.jsp";
	}
	
	@Override
	void readRow(List<CrawlerSubjectInfo> list) throws Exception {
		String tmp;
		CrawlerSubjectInfo sub = new CrawlerSubjectInfo();

		CrawlerUtils.readSingleData(CrawlerUtils.pattern1, reader);
		tmp = CrawlerUtils.readSingleData(CrawlerUtils.pattern1, reader);
	///	M.log("crawl", tmp);
		int i = CrawlerUtils.lastDash(tmp);
		sub.setName(CrawlerUtils.titleCase(tmp.substring(0, tmp.indexOf('(')).trim()));

// Path: Webkiosk/src/main/java/com/blackMonster/webkiosk/utils/M.java
// public class M {
// 	private static final boolean showLog = true;
// 	public static void log(String TAG, String text) {
// 		if (showLog) Log.d(TAG, text);
// 
// 	/*	File logFile = new File("sdcard/log.txt");
// 		if (!logFile.exists()) {
// 			try {
// 				logFile.createNewFile();
// 			} catch (IOException e) {
// 				e.printStackTrace();
// 			}
// 		}
// 		try {
// 			// BufferedWriter for performance, true to set append to file flag
// 			BufferedWriter buf = new BufferedWriter(new FileWriter(logFile,
// 					true));
// 			String mydate = java.text.DateFormat.getDateTimeInstance().format(Calendar.getInstance().getTime());
// 			buf.append(mydate + "     " + TAG + " --->  " + text);
// 			Log.d(TAG, text);
// 			buf.newLine();
// 			buf.close();
// 		} catch (IOException e) {
// 			e.printStackTrace();
// 		}*/
// 	}
// }
// 
// Path: Webkiosk/src/main/java/com/blackMonster/webkiosk/crawler/Model/CrawlerSubjectInfo.java
// public class CrawlerSubjectInfo extends SubjectAttendance {
// 
//     private String link;
// 
//     public String getLink() {
//         return link;
//     }
// 
//     public void setLink(String link) {
// 
//         if (link == null || link.equals(""))
//             link = null;
// 
//         this.link = link;
//     }
// }


// Path: Webkiosk/src/main/java/com/blackMonster/webkiosk/crawler/SubjectDetailsFromPreReg.java
import com.blackMonster.webkiosk.utils.M;
import com.blackMonster.webkiosk.crawler.Model.CrawlerSubjectInfo;
import java.util.ArrayList;
import java.util.List;
import cz.msebera.android.httpclient.client.HttpClient;

		while (true) {
			tmp = reader.readLine();
			if (tmp == null)
				throw new BadHtmlSourceException();

			if (tmp.contains("</tbody>"))
				break;

			if (tmp.contains("<tr>")) {
				readRow(list);
			}
		}

	}
	@Override
	String getMainUrl() {
		return WebkioskWebsite.getSiteUrl(colg) + "/StudentFiles/Academic/PRStudentView.jsp";
	}
	
	@Override
	void readRow(List<CrawlerSubjectInfo> list) throws Exception {
		String tmp;
		CrawlerSubjectInfo sub = new CrawlerSubjectInfo();

		CrawlerUtils.readSingleData(CrawlerUtils.pattern1, reader);
		tmp = CrawlerUtils.readSingleData(CrawlerUtils.pattern1, reader);
	///	M.log("crawl", tmp);
		int i = CrawlerUtils.lastDash(tmp);
		sub.setName(CrawlerUtils.titleCase(tmp.substring(0, tmp.indexOf('(')).trim()));

		sub.setSubCode("T" + (tmp.substring(tmp.indexOf('(') + 1, tmp.indexOf(')'))).trim());