summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-07-28 13:11:27 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-07-28 13:11:27 (GMT)
commitf8282266535b1d86e0f44503243239265d246fe8 (patch)
tree58552b2cea46643d47e7635f5f41734e59f854fc
parentdd7de6cfb93f8812189f8365a6c8659d0686678d (diff)
downloadswift-contrib-f8282266535b1d86e0f44503243239265d246fe8.zip
swift-contrib-f8282266535b1d86e0f44503243239265d246fe8.tar.bz2
No multiline silliness
-rw-r--r--Swiftob/scripts/urlGrabber.lua7
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