forked from kristoffer-dyrkorn/mightycrawler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrawler.properties
executable file
·104 lines (79 loc) · 3.88 KB
/
crawler.properties
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# where to start crawling. host names must end with /, eg. http://127.0.0.1/
# multiple start points can be provided, one per line, each line ending with \
# and next line starting with |.
#
# example:
# startURLs=http://127.0.0.1/\
# |http://www.localhost.com/
startURLs=http://dusken.no
# restrict visits to urls matching this regex. default: everything under the startURLs
#includePattern=
# among the included urls, exclude those matching this regex. default: no exclusions
# example: excludePattern=http://127.0.0.1/news/.*|http://127.0.0.1/sports/.*
# excludePattern=
# scan mode: just visit the URLs provided in the file (one URL per line).
# if a filename is given here, crawling will be disabled.
# urlFile=urllist.txt
# all content matching the regex here will be subject to link extraction. default: no extraction.
# example: extract=text/html|text/plain
extractPattern=text/html
# when doing link extraction, the text that is captured by this regexp will be regarded as a link
# example: link=href=\"(.*?)\"|src=\"(.*?)\"
linkPattern=href=\"(.*?)\"
# the response body of all content types matching this regex will be stored on disk. default: no content will be stored.
# example: storePattern=text/html|application/x-javascript
storePattern=text/html
# the user agent.
userAgent=
# specify cookie handling, with an option to ignore cookies.
# load balancers often use cookies to ensure session stickyness, thus ignoring cookies will make requests
# spread out across the load balanced servers.
# Default: true (cookies are handled like a normal browser does)
# useCookies=true
# specify whether the crawler should follow redirects. if true, only the final URL
# (after redirect) will be logged. Default: true
# followRedirects=true
# number of threads for downloading.
downloadThreads=10
# visit up to n pages.
maxVisits=100
# download up to n pages.
maxDownloads=500
# stop after crawling n levels of links
maxRecursion=5
# stop after crawling for n minutes
maxTime=300
# let each download thread wait n seconds before it starts.
downloadDelay=1
# move on if a request gets no response after n seconds.
responseTimeout=30
# stop crawling if no new urls are found within n seconds.
crawlerTimeout=30
# where to put the downloaded web sites. mandatory!
outputDirectory=websites/
# where to put download statistics. mandatory!
createReport = true
reportDirectory=reports/
# where to put the crawler database. mandatory!
databaseDirectory=database/
db.driver = org.hsqldb.jdbcDriver
db.connectionString = jdbc:hsqldb:file:reports/database/database
# SQL statements for generating reports after a run.
reportSQL=select http_code, url from downloads where http_code <> [email protected]\
|select url_to, url_from from [email protected]\
|select downloaded_at, url from downloads where [email protected]\
|select COUNT(*) + ' pages downloaded.' from downloads where [email protected]\
|select 'Crawling took ' + DATEDIFF('mi', MIN(downloaded_at), MAX(downloaded_at)) + ' minutes.' from downloads where [email protected]\
|select 'Average response time: ' + 0.001 * SUM(response_time) / COUNT(*) + ' seconds.' from downloads where [email protected]\
|select response_time, url from downloads where [email protected]\
|select response_time, url from downloads where downloaded=true order by response_time desc@responsetimes_sorted.txt\
|select url from downloads where [email protected]\
|select url from downloads where content_type='application/pdf'@pdffiles.txt
# data model for the download statistics:
#
# downloads
# url VARCHAR(4095) | http_code INTEGER default 0 | content_type VARCHAR(255) | response_time INTEGER default 0 | downloaded_at DATETIME default NOW | downladed BOOLEAN
#
# links
# url_from VARCHAR(4095) | url_to VARCHAR(4095)
#