--[[ <HCExtension>@name caching@author zoynels@yandex.ru@version 0.01@description caching@rule bits\.wikimedia\.org/@event URLToFileNameConverting/conv</HCExtension> ]]function conv() if not conv_url then conv_url = {} end local url = conv_url[hc.monitor_index] or hc.url hc.put_to_log('url: ' .. url) local cache_file_name = hc.prepare_url(url,false) hc.put_to_log('Cache_file_name:' .. cache_file_name) hc.preform_cache_file_name(cache_file_name) hc.monitor_string = hc.monitor_string .. ', Cache Extention ' .. cache_file_name conv_url[hc.monitor_index] = urlend
--[[ <HCExtension>@name ### Temp-1 ###@event BeforeRequestHeaderSend/T001</HCExtension> ]]function T001() if re.find(hc.request_header, [[^Accept: text/html,]]) then return else hc.action = 'stop' end hc.answer_header = 'HTTP/1.1 403 lock (R-ext-FF)\r\nConnection: Close\r\nContent-Type: image/png\r\n\r\n' hc.answer_body= 'file=D:\\HandyCache\\R-ext-FF.png' hc.monitor_string = hc.monitor_string..'R-ext-FF 'end
--[[ <HCExtension>@name ### Temp-2 ###@event BeforeRequestHeaderSend/T001</HCExtension> ]]function body()-- if not hc.last_part then hc.answer_body= 'file=D:\\HandyCache\\R-ext-FF.png'-- end hc.put_to_log('B - '..hc.answer_body)endfunction T001() local function Stop() if re.find(hc.request_header, [[^Accept: text/html,]]) then return else hc.call_me_for('BeforeAnswerBodySend', 'body') end hc.action = 'stop' hc.monitor_string = hc.monitor_string..'R-ext-FF ' end if not re.find(hc.request_header, [[^Referer:]]) then return else Stop() -- Блокируем загрузку endend
--[[ <HCExtension>@name ### Temp ###@event BeforeRequestHeaderSend/T001@event BeforeAnswerBodySend/body</HCExtension> ]]function body() hc.put_to_log('B1 - '..hc.answer_body)-- if not hc.last_part then-- hc.answer_body= 'file=D:\\HandyCache\\R-ext-FF.png'-- end hc.put_to_log('B2 - '..hc.answer_body)endfunction T001() hc.action = 'stop'end
file=D:\HandyCache\R-ext-FF.pngfile=D:\HandyCache\R-ext-FF.png
file=D:\HandyCache\R-ext-FF.png
10.02.2013/17:41:32 local/127.0.0.1 http://ya.ru/gfeg.5gtr 0 0/73 0 0 "430 lock (A-40X)"
10.02.2013/17:50:51 local/127.0.0.1 http://ya.ru/gfeg.5gtr 4373 4373/585 100% 331 "403 Forbidden (HC)"
--[[ <HCExtension>@name ### Temp ###@rule \Ahttp://ya\.ru@event AnswerHeaderReceived/Stop@event BeforeAnswerHeaderSend</HCExtension> ]]function BeforeAnswerHeaderSend() hc.answer_header = 'HTTP/1.1 430 lock (A-40X)\r\nConnection: Close\r\nContent-Type: text/html\r\n\r\n'endfunction Stop() hc.action = 'stop'end