diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-05-30 19:10:16 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-05-30 19:10:16 +0000 |
commit | 04503eb37544a0af28b0be1b4849c922ff2e25c8 (patch) | |
tree | 6e1a0a6c5be54f63e9c496ceedad517493b5d429 /weblog-model.lua | |
parent | 74097acfc0a49c2b28604f1760b31f9f38b6c5fa (diff) | |
download | acf-weblog-04503eb37544a0af28b0be1b4849c922ff2e25c8.tar.bz2 acf-weblog-04503eb37544a0af28b0be1b4849c922ff2e25c8.tar.xz |
Fix http(s) getlogcandidates to work with acf-alpine-baselayout-0.12.0
Diffstat (limited to 'weblog-model.lua')
-rw-r--r-- | weblog-model.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/weblog-model.lua b/weblog-model.lua index eca067a..3b3cc40 100644 --- a/weblog-model.lua +++ b/weblog-model.lua @@ -638,9 +638,18 @@ local getlogcandidates = function(source, cookiesfile) local candidates = {} if source.method == "http" or source.method == "https" then local resultpage = modelfunctions.run_executable({"wget", "-O", "-", "--no-check-certificate", "--load-cookies", cookiesfile, source.method.."://"..source.source.."/cgi-bin/acf/alpine-baselayout/logfiles/status"}) + -- This method works for view prior to acf-alpine-baselayout-0.12.0 for file in string.gmatch(resultpage, "download%?[^\"]*name=([^\"]+)") do candidates[#candidates+1] = file end + -- This method works for view from acf-alpine-baselayout-0.12.0 + local reversetable = {} + for file in string.gmatch(resultpage, 'name="filename" value="([^\"]+)"') do + if not reversetable[file] then + candidates[#candidates+1] = file + reversetable[file] = true + end + end elseif source.method == "local" then candidates = fs.find_files_as_array(nil, source.source) end |