Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit b723c06

Browse files
author
Tom Bell
committed
Merge pull request #982 from contolini/master
Add option to exclude descriptions from http-info script
2 parents 0d2fa35 + e6078cf commit b723c06

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/scripts/http-info.coffee

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
#
88
# Configuration:
99
# HUBOT_HTTP_INFO_IGNORE_URLS - RegEx used to exclude Urls
10-
# HUBOT_HTTP_INFO_IGNORE_USERS - Comma separated list of users to ignore
10+
# HUBOT_HTTP_INFO_IGNORE_USERS - Comma-separated list of users to ignore
11+
# HUBOT_HTTP_INFO_IGNORE_DESC - Optional boolean indicating whether a site's meta description should be ignored
1112
#
1213
# Commands:
1314
# http(s)://<site> - prints the title and meta description for sites linked.
@@ -50,8 +51,10 @@ module.exports = (robot) ->
5051
$ = window.$
5152
title = $('title').text()
5253
description = $('meta[name=description]').attr("content") || ""
53-
description = "\n" + description if description
5454

55-
if title
56-
msg.send "#{title}#{description}"
55+
if title and description and not process.env.HUBOT_HTTP_INFO_IGNORE_DESC
56+
msg.send "#{title}\n#{description}"
57+
58+
else if title
59+
msg.send "#{title}"
5760
)

0 commit comments

Comments
 (0)