Skip to content

Commit

Permalink
Merge pull request github#113 from KevinTraver/master
Browse files Browse the repository at this point in the history
All titles should now return as single line.
  • Loading branch information
atmos committed Nov 8, 2011
2 parents c5564e7 + c1b3d69 commit 8b0d9da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/web.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ module.exports = (robot) ->
parser.parseComplete body
results = (Select handler.dom, "head title")
if results[0]
msg.send results[0].children[0].data
msg.send results[0].children[0].data.replace(/(\r\n|\n|\r)/gm,"")
else
results = (Select handler.dom, "title")
if results[0]
msg.send results[0].children[0].data
msg.send results[0].children[0].data.replace(/(\r\n|\n|\r)/gm,"")
else
msg.send "Error " + res.statusCode

Expand All @@ -39,7 +39,7 @@ module.exports = (robot) ->
format: "json"
.get() (err, res, body) ->
response = JSON.parse body
responseTitle = response.data.info[0].title
responseTitle = response.data.info[0].title.replace(/(\r\n|\n|\r)/gm,"")
if responseTitle
msg.send if response.status_code is 200 then responseTitle else response.status_txt
else
Expand Down

0 comments on commit 8b0d9da

Please sign in to comment.