Skip to content

Commit

Permalink
Removed .imdb and fixed apt test
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyLemon committed May 25, 2017
1 parent b4897c4 commit dbc69e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
26 changes: 1 addition & 25 deletions scripts/servisi.coffee
Expand Up @@ -60,30 +60,6 @@ module.exports = (bot) ->
zamenjaj vrednost, from, to, (answer)->
r.reply "#{r.nick}: #{answer}"

bot.regexp /^\.imdb (.+)/,
".imdb <naslov> -- Dobi osnovne podatke z OMDB ",
(match, r) ->
f = match[1].trim()
imdb = (ime, cb)->
url = "http://www.omdbapi.com/?t=#{ime}&y=&r=json&tomatoes=true"
bot.fetchJSON url, (data) ->
if data.Response == "False"
msg = "Ne najdem!"
#console.log msg
cb msg
if data.Response == "True"
msg = "#{data.Title} |#{data.Released} #{data.Runtime}| #{data.Genre}\n#{data.Plot}\nIMDB:#{data.imdbRating}/10 (#{data.imdbVotes} glasov) | Tomato: #{data.tomatoRating}/10 #{data.tomatoReviews} reviews (users: #{data.tomatoUserRating}/5 #{data.tomatoUserReviews} reviews) \
\nPovezava: https://www.imdb.com/title/#{data.imdbID}"
#console.log msg
redis.setex("imdb:#{ime}", 24*60*5, msg)
cb msg

redis.get("imdb:#{f}").then (res)->
unless res
imdb f, r.reply
else
r.reply res

bot.regexp /^\.stran (.*)/i,
".stran <domena> -- Ali stran dela?",
(match, irc) ->
Expand Down Expand Up @@ -199,6 +175,6 @@ module.exports = (bot) ->
if data && ! null
r.reply "#{data.safe_title}: #{data.img}"
else
r.reply "Ne najdem"
r.reply "Ne najdem"
else
r.reply "Ne najdem"
2 changes: 1 addition & 1 deletion test/apt.coffee
Expand Up @@ -11,7 +11,7 @@ describe 'apt.coffee', ->
it 'test .apt libssl-dev', (done)->
bot.test ".apt libssl-dev", (msg)->
expect(msg).to.be.a('string')
msg.should.equal 'libssl-dev {precise (12.04LTS), trusty (14.04LTS), xenial (16.04LTS), yakkety (16.10), zesty}'
msg.should.equal 'libssl-dev {trusty (14.04LTS), xenial (16.04LTS), yakkety (16.10), zesty, artful}'
done()

it 'test .aptf evp.h', (done)->
Expand Down

0 comments on commit dbc69e5

Please sign in to comment.