Repeatable scraping session

If you need your scraping session to run multiple times in succession, consider this script, which will repeat multiple times until it either hits the "quitTime" specified (24-hour clock), or when it hits the "maxRuns" allowed. To quickly (and dirtily) disable the "maxRuns" factor, set it to 0, or something negative. To disable the time restraint in "quitTime", just make sure it starts with something greater than or equal to 24 (for example, "24:00" or "123412:43").

// Interpreted Java
String toRun = "first scrapeableFile name";
String quitTime = "14:43";
int maxRuns = 5;

/* No need to edit below here ----------------------------------- */

import java.text.SimpleDateFormat;
import java.util.Calendar;

if (quitTime.length() == 4)
    quitTime = "0" + quitTime;

for (int i = 1; (new SimpleDateFormat("HH:mm")).format(Calendar.getInstance().getTime()).toString().compareTo(quitTime) < 0; i++)
{
    session.scrapeFile(toRun);
    if (i == maxRuns)
        break;
}