examples/urls.lua
author Myhailo Danylenko <isbear@ukrpost.net>
Fri, 02 Apr 2010 20:00:20 +0300
changeset 102 f3d9d9e67ee4
parent 58 aa3376776cf2
permissions -rw-r--r--
Remove debugging line from mime-type


-- SAVING URLS TO FILE

hooks_d['hook-message-in'].urls =
	function ( args )
		for url in args.message:gmatch ( "https?://[%w%p]+" ) do
			fd = io.open ( main.fileoption 'lua_url_file', "a" )
			if fd then
				fd:write ( url .. "\n" )
				fd:close ()
			else
				print 'Cannot open urls log file'
			end
		end
	end

-- vim: se ts=4: --