Skip to content

Commit

Permalink
Feature that had no future - but look at it now
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyLemon committed Sep 25, 2017
1 parent 2cefbc1 commit 202644c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/url.coffee
@@ -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, "")
Expand Down

0 comments on commit 202644c

Please sign in to comment.