From f8282266535b1d86e0f44503243239265d246fe8 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Sat, 28 Jul 2012 14:11:27 +0100 Subject: No multiline silliness diff --git a/Swiftob/scripts/urlGrabber.lua b/Swiftob/scripts/urlGrabber.lua index 180c582..e9f9754 100644 --- a/Swiftob/scripts/urlGrabber.lua +++ b/Swiftob/scripts/urlGrabber.lua @@ -1,5 +1,5 @@ function url_grabber(body, muc, nick, message) - url = body:match("http://.%S+") + local url = body:match("http://.%S+") print("Looking for URL") print(url) if url then @@ -10,11 +10,12 @@ function url_grabber(body, muc, nick, message) --clen = tonumber(h["content-length"]) --if clen and clen > 0 and clen < 1024 * 1024 then b, c, h = http.request(url) - subjectish = b:match(".+") + local subjectish = b:match(".+") print("subjectish") print(subjectish) if subjectish then - subject = string.gsub(subjectish, "", "") + local subject = string.gsub(subjectish, "", "") + subject = subject:gsub("\n", " | "); if subject then swiftob_reply_to(message, url..":\n"..subject) end -- cgit v0.10.2-6-g49f6