Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1158 from datr/drupalorg

Extend the drupalorg script to match more drupal.org urls.
  • Loading branch information...
commit 82ee1c52bf2896fa997f40bbff995bcc9e1e0b48 2 parents b383588 + af60f4a
Josh Nichols technicalpickles authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/scripts/drupalorg.coffee
6 src/scripts/drupalorg.coffee
View
@@ -3,6 +3,7 @@
#
# Dependencies:
# "jsdom" : ">0.2.1"
+# "request" : ""
#
# Configuration:
# NONE
@@ -19,6 +20,7 @@
# guyoron
+request = require 'request'
jsdom = require 'jsdom'
jquery = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'
@@ -62,7 +64,7 @@ module.exports = (robot) ->
url = msg.match[0]
return if recentLinks.contains url
recentLinks.add url
- msg.http(url).headers('User-Agent': 'hubot').get() (err, res, body) ->
+ request {url: url, headers: {'User-Agent': 'hubot'}}, (err, res, body) ->
if err
console.log "Errors getting url: #{url}"
return
@@ -105,4 +107,4 @@ module.exports = (robot) ->
msg.send "#{url} => #{results[0]} [#{results[1]}, #{results[2]}]"
# listen for page links
- robot.hear /http:\/\/drupal.org\/node\/(\d+)/, fetchPage
+ robot.hear /https?:\/\/(www.)?drupal.org\/node\/(\d+)/, fetchPage
Please sign in to comment.
Something went wrong with that request. Please try again.