Compare commits

..

No commits in common. "e5f83ec639f998d7c04d12d07c53edc1edb12047" and "373c88302710365552d204bd8c7c71a308b56f97" have entirely different histories.

4 changed files with 3250 additions and 1704 deletions

4908
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,28 +14,28 @@
"url": "https://lanxu@bitbucket.org/lanxu/kulmapaikka-ircbot"
},
"dependencies": {
"chance": "=1.1.13",
"cheerio": "^1.1.2",
"cron": "=4.3.3",
"file-stream-rotator": "=1.0.0",
"finalhandler": "=2.1.0",
"googleapis": "^154.1.0",
"html-to-text": "=9.0.5",
"chance": "=1.0.18",
"cheerio": "^1.0.0-rc.2",
"cron": "=1.7.1",
"file-stream-rotator": "=0.4.1",
"finalhandler": "=1.1.2",
"googleapis": "^91.0.0",
"html-to-text": "=5.1.1",
"irc": "=0.5.2",
"lokijs": "=1.5.12",
"mkdirp": "=3.0.1",
"morgan": "=1.10.1",
"node-cron": "^4.2.1",
"node-dev": "^8.0.0",
"lokijs": "=1.5.7",
"mkdirp": "=0.5.5",
"morgan": "=1.9.1",
"node-cron": "^2.0.3",
"node-dev": "^7.1.0",
"node-uuid": "=1.4.8",
"promise": "=8.3.0",
"promise": "=8.0.3",
"request": "=2.88.0",
"request-promise": "=4.2.4",
"twitter": "=1.7.1",
"winston": "=3.17.0",
"winston-daily-rotate-file": "^5.0.0"
"winston": "=3.2.1",
"winston-daily-rotate-file": "^3.10.0"
},
"devDependencies": {
"nodemon": "^3.1.10"
"nodemon": "^2.0.15"
}
}

View File

@ -3,22 +3,22 @@ var requestPromise = require('./helpers/requestPromise.js')
var BasePlugin = require('./base.js')
var htmlToText = require('html-to-text')
class Mastodon extends BasePlugin {
constructor(config) {
constructor (config) {
super(config)
this.name = 'Mastodon'
}
test(input) {
if (input.match(/http(s)?:\/\/(www\.)?((.*\..*\/users\/([a-zA-Z0-9_-]*)\/statuses\/([0-9_-]*)))$/)) {
test (input) {
if (input.match(/http(s)?:\/\/(www\.)?((.*\..*\/users\/([a-zA-Z0-9_-]*)\/statuses\/([0-9_-]*)))/)) {
return true
}
if (input.match(/http(s)?:\/\/(www\.)?(((.*\..*)\/@([a-zA-Z0-9_-]*)\/([0-9_-]*)))$/)) {
if (input.match(/http(s)?:\/\/(www\.)?(((.*\..*)\/@([a-zA-Z0-9_-]*)\/([0-9_-]*)))/)) {
return true
}
return false
}
getToot(host, statusId) {
getToot (host, statusId) {
var promise = new Promise(function (resolve, reject) {
var url = 'https://' + host + '/api/v1/statuses/' + statusId
requestPromise(url, {}, {
@ -49,7 +49,7 @@ class Mastodon extends BasePlugin {
return promise
}
result(input) {
result (input) {
var that = this
var resultPromise = new Promise(function (resolve, reject) {
var host = null

View File

@ -177,7 +177,7 @@ class Weather extends BasePlugin {
var windspeed = result.wind.speed
let str = city + ', ' + country + ' (' + temp + ' °C, ' + that.iconCodeToText[code] + ', ilmankosteus: ' + humidity + ' %, ilmanpaine: ' + pressure + ' hPa, tuulen nopeus: ' + windspeed + ' m/s)'
let str = 'Sää: ' + city + ', ' + country + ' (' + temp + ' °C, ' + that.iconCodeToText[code] + ', ilmankosteus: ' + humidity + ' %, ilmanpaine: ' + pressure + ' hPa, tuulen nopeus: ' + windspeed + ' m/s)'
resolve('Sää: ' + str)
}
}, function (error) {