|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.Internet
public class Internet
static functions relevant to downloading .html and text files from the internet,
reading them, finding URL links, and searching for information.
Try to obey http://website/robots.txt if it has a robots.txt.
Field Summary | |
---|---|
static int |
defaultSearchLiquidBytesDownloadInternetAmount
|
static int |
defaultSearchMaxCacheMillisOld
|
static int |
defaultSearchMaxDurationMillis
|
static int |
defaultSearchTargetReturnQuantity
|
Method Summary | |
---|---|
static java.lang.String |
download(java.lang.String url,
Liquid liquidBytesDownloadInternet,
double maxCacheMillisOld)
returns the download from cache if the cached copy is new enough. |
static int |
maxMillisToWaitWhileNoBytesDownloadedBeforeEndingDownload()
returns 20000, 20 seconds |
static int |
minBytesPerSecondToKeepDownloading()
returns 30000. |
static java.lang.String[] |
possibleRobotsDotTxtLocations(java.lang.String url)
given any URL, guesses where a robots.txt file may be found. |
static CS[] |
search(java.lang.String[] startSearchingFromUrls,
CS measureOfText)
tries to get Liquid from class FreeLiquid |
static CS[] |
search(java.lang.String[] startSearchingFromUrls,
CS measureOfText,
Liquid liquidBytesDownloadInternet)
|
static CS[] |
search(java.lang.String[] startSearchingFromUrls,
CS measureOfText,
Liquid liquidBytesDownloadInternet,
int targetReturnQuantity,
int maxSearchDurationMillis,
int maxCacheMillisOld)
Searches the internet for text that scores the highest. |
static void |
throwIfNotValidURL(java.lang.String url)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int defaultSearchTargetReturnQuantity
public static final int defaultSearchMaxDurationMillis
public static final int defaultSearchMaxCacheMillisOld
public static final int defaultSearchLiquidBytesDownloadInternetAmount
Method Detail |
---|
public static CS[] search(java.lang.String[] startSearchingFromUrls, CS measureOfText, Liquid liquidBytesDownloadInternet, int targetReturnQuantity, int maxSearchDurationMillis, int maxCacheMillisOld)
startSearchingFromUrls
- are where to start searching.
measureOfText
- is the goal function. Put text in its P0 and execute it.
Returns a higher number for better text.
liquidBytesDownloadInternet.amount()
- is maximum bytes that can be downloaded from internet in this search.
liquidBytesDownloadInternet.amount() decreases when bytes are downloaded.
If not all bytes are used, the caller should take the remaining Liquid.
targetReturnQuantity
- is how big an array you want returned. Array may be smaller but not bigger.
maxSearchDurationMillis
- is how long the search may last before being forcefully ended.
maxCacheMillisOld
- is how many milliseconds old a page in cache may be and still return it.public static CS[] search(java.lang.String[] startSearchingFromUrls, CS measureOfText, Liquid liquidBytesDownloadInternet)
public static CS[] search(java.lang.String[] startSearchingFromUrls, CS measureOfText)
public static java.lang.String download(java.lang.String url, Liquid liquidBytesDownloadInternet, double maxCacheMillisOld)
public static int minBytesPerSecondToKeepDownloading()
public static int maxMillisToWaitWhileNoBytesDownloadedBeforeEndingDownload()
public static java.lang.String[] possibleRobotsDotTxtLocations(java.lang.String url)
public static void throwIfNotValidURL(java.lang.String url)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |