home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 November
/
PCWorld_2007-11_cd.bin
/
temacd
/
bitcomet
/
BitComet_0.93_setup.exe
/
scripts
/
soft_mydown.lua
< prev
next >
Wrap
Text File
|
2007-01-11
|
844b
|
33 lines
function url_process(linkurl, fileurl, str)
local pattern_name = "<[Tt][Ii][Tt][Ll][Ee]>%s*(.-)%s*下载</[Tt][Ii][Tt][Ll][Ee]>"
local pattern_ext = ".*(%..-)$"
local start, _, tmp
local base_name, ext
start, _, tmp = string.find(str, pattern_name)
if start == nil then return "" else base_name = tmp end
if fileurl == nil then return "" end
start, _, tmp = string.find(fileurl, pattern_ext)
if start == nil then return "" else ext = tmp end
return base_name .. ext
end
function url_query(str)
local start
local pattern_url = "http://www.mydown.com/"
start = string.find(str, pattern_url)
if start == nil then return false end
return true
end
f = {}
f.process = url_process
f.accept = url_query
inteligent_name_table["soft_mydown.lua"] = f