blob: 7c3fb80324af76010228249af889536edbc6a08d (
plain)
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
|
local normalizer = GoogleURLNormalizer:new( )
local baseUrl = normalizer:parseUrl( "http://www.base.com" )
io.write( "base URL is: " .. baseUrl:str( ) .. "\n" )
local url = normalizer:normalize( baseUrl, "/relativedir/relativefile.html" )
io.write( "URL is: " .. url:str( ) .. "\n" )
normalizer:delete( )
-- global setting
crawler = {
-- stop after N documents
stop_after_N_operations = 10
}
logger = {
level = DEBUG
}
-- seeds: URLS which are fed in the beginning to the URL frontier
seeds = {
"http://www.wolframe.net",
"http://wolframe.net"
}
filters = {
-- allowed protocols to be fetched
protocols = {
"http",
"https"
},
-- allowed hosts to be crawled (FQDN)
hosts = {
"www.wolframe.net",
"wolframe.net"
}
}
function crawl( )
io.write( "Crawling." )
end
|