diff options
-rw-r--r-- | Swiftob/scripts/urlGrabber.lua | 7 |
1 files changed, 4 insertions, 3 deletions
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("<title>.+</title>") + local subjectish = b:match("<title>.+</title>") print("subjectish") print(subjectish) if subjectish then - subject = string.gsub(subjectish, "</?title>", "") + local subject = string.gsub(subjectish, "</?title>", "") + subject = subject:gsub("\n", " | "); if subject then swiftob_reply_to(message, url..":\n"..subject) end |