Permalink
...
Comparing changes
Open a pull request
- 4 commits
- 3 files changed
- 0 commit comments
- 1 contributor
Unified
Split
Showing
with
2 additions
and 56 deletions.
- +1 −25 scripts/servisi.coffee
- +1 −1 test/apt.coffee
- +0 −30 test/servisi.coffee
View
26
scripts/servisi.coffee
| @@ -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) -> | ||
| @@ -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" | ||
View
2
test/apt.coffee
| @@ -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)-> | ||
View
30
test/servisi.coffee
| @@ -7,13 +7,6 @@ fat = require '../lib/fat_tests' | ||
| describe 'servisi.coffee', -> | ||
| this.timeout 16000 | ||
| bot = require("../scripts/servisi")(new fat.BotTest()) | ||
| - | ||
| - it 'test .imdb helion', (done)-> | ||
| - bot.test ".imdb helion", (msg)-> | ||
| - expect(msg).to.be.a('string') | ||
| - expect(msg).to.equal "Ne najdem!" | ||
| - done() | ||
| - | ||
| it 'test .stran ubuntu.si', (done)-> | ||
| bot.test ".stran ubuntu.si", (msg)-> | ||
| expect(msg).to.be.a('string') | ||
| @@ -30,29 +23,6 @@ describe 'servisi.coffee', -> | ||
| expect(bot.help.length).to.be.at.least 2 | ||
| done() | ||
| - it 'test .imdb American Pie', (done)-> | ||
| - bot.test ".imdb American pie", (msg)-> | ||
| - expect(msg).to.be.a('string') | ||
| - expect(msg.length).to.be.at.least 100 | ||
| - done() | ||
| - | ||
| - it 'test .imdb Iron Sky', (done)-> | ||
| - bot.test ".imdb Iron Sky", (msg)-> | ||
| - expect(msg).to.be.a('string') | ||
| - expect(msg.length).to.be.at.least 100 | ||
| - done() | ||
| - | ||
| - it 'test .imdb mozje x', (done)-> | ||
| - bot.test ".imdb mozje x", (msg)-> | ||
| - expect(msg).to.be.a('string') | ||
| - done() | ||
| - | ||
| - it 'test .imdb The Hobbit: The Desolation of Smaug', (done)-> | ||
| - bot.test ".imdb The Hobbit: The Desolation of Smaug", (msg)-> | ||
| - expect(msg).to.be.a('string') | ||
| - expect(msg).to.not.equal "Ne najdem!" | ||
| - done() | ||
| - | ||
| it 'test .rt', (done)-> | ||
| bot.test ".rt", (msg)-> | ||
| expect(msg).to.be.a('string') | ||