Permalink
Browse files

Feature that had no future - but look at it now

  • Loading branch information...
1 parent 2cefbc1 commit 202644cef3b57cfe0494f5a6f3c8e765f0c41079 @CrazyLemon CrazyLemon committed Sep 25, 2017
Showing with 5 additions and 3 deletions.
  1. +5 −3 scripts/url.coffee
View
@@ -1,11 +1,13 @@
module.exports = (bot) ->
- is_url = /(https?[\w:\/\.;&\?_\-\#=]+)/g;
+ is_url = /(((https?:\/\/)|(www\.?))[^\s]+)/
resolve = (url, cb)->
if is_url.test url
- url = url.match(is_url)[0]
- bot.fetchHTML url, ($)->
+ url = url.match(is_url)
+ if url[0].substring(0,3) == "www"
+ url[0] = "http://" + url[0]
+ bot.fetchHTML url[0], ($)->
if $
stack = []
stack.push $("title").eq(0).text().replace(/\s\s+/g, "").replace(/ /g,"").replace(/\n/g, "")

0 comments on commit 202644c

Please sign in to comment.