Skip to content

Commit

Permalink
Revert "Merge pull request #56 from ubuntu-si/feature/show-forum-posts"
Browse files Browse the repository at this point in the history
This reverts commit 8e85c69, reversing
changes made to 5d0f23a.
  • Loading branch information
CrazyLemon committed Jan 7, 2017
1 parent 8e85c69 commit b126946
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/chatter.coffee
Expand Up @@ -125,7 +125,7 @@ module.exports = (bot) ->
bot.fetchJSON url.replace(/%20/g,'+'), (result) ->
if result.pagination.total_count > 0
gif = "#{result.data[0].id}.gif"
r.reply "http://i.giphy.com/#{gif}"
r.reply " http://i.giphy.com/#{gif}"
else
r.reply "No gif available :("

Expand Down
6 changes: 2 additions & 4 deletions scripts/url.coffee
@@ -1,15 +1,13 @@
module.exports = (bot) ->

is_url = /(?:^https?:\/\/|^(www\.?)).+/
is_url = /^(https?):\/\/.+/

resolve = (url, cb)->
if is_url.test url
if url.substring(0,3) == "www"
url = "http://" + url
bot.fetchHTML url, ($)->
if $
stack = []
stack.push $("title").text().replace(/\s\s+/g, "")
stack.push $("title").text()
opis = $("meta[name=description]").attr("content")
if opis
stack.push opis
Expand Down
2 changes: 2 additions & 0 deletions test/chatter.coffee
Expand Up @@ -10,12 +10,14 @@ describe 'chatter.coffee', ->

it 'test .rainbow love', (done)->
bot.test ".rainbow love", (msg)->
console.log(msg)
expect(msg).to.be.a('string')
done()

it 'test .gif get lucky', (done)->
bot.test ".gif get lucky", (msg)->
expect(msg).to.be.a('string')
console.log msg
done()

it 'test spread some love', (done)->
Expand Down

0 comments on commit b126946

Please sign in to comment.