Skip to content

Commit

Permalink
remove ddg
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Dec 31, 2015
1 parent 2b6ed8b commit 76c776a
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions scripts/chatter.coffee
@@ -1,4 +1,3 @@
ddg = require('ddg')
colors = require('irc-colors')

module.exports = (bot) ->
Expand Down Expand Up @@ -131,20 +130,6 @@ module.exports = (bot) ->
]
r.reply bot.random vic

bot.regexp /^\.d (.+)/,
".d -- Vse kar zna https://api.duckduckgo.com/api ali https://api.duckduckgo.com/goodies",
(match, r) ->
options =
useragent: "ubuntu.si"
no_redirects: "1"
no_html: "1"

ddg.query match[1].trim(), options, (err, data) ->
r.reply data.AbstractText
r.reply data.Definition
r.reply data.Answer
r.reply data.AbstractURL || data.Redirect

bot.regexp /^\.gif (.+)/, ".gif <query> -- Prikaže naključni gif", (match, r) ->
url = "http://giphy.com/search/#{encodeURI(match[1].replace(/[^a-z0-9\s]/g,"").replace(/\s\s+/g, "-"))}"
bot.fetchHTML url.replace(/%20/g, '-'), ($) ->
Expand Down

0 comments on commit 76c776a

Please sign in to comment.