Compare commits
No commits in common. "e5f83ec639f998d7c04d12d07c53edc1edb12047" and "373c88302710365552d204bd8c7c71a308b56f97" have entirely different histories.
e5f83ec639
...
373c883027
4900
package-lock.json
generated
4900
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
32
package.json
32
package.json
@ -14,28 +14,28 @@
|
|||||||
"url": "https://lanxu@bitbucket.org/lanxu/kulmapaikka-ircbot"
|
"url": "https://lanxu@bitbucket.org/lanxu/kulmapaikka-ircbot"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chance": "=1.1.13",
|
"chance": "=1.0.18",
|
||||||
"cheerio": "^1.1.2",
|
"cheerio": "^1.0.0-rc.2",
|
||||||
"cron": "=4.3.3",
|
"cron": "=1.7.1",
|
||||||
"file-stream-rotator": "=1.0.0",
|
"file-stream-rotator": "=0.4.1",
|
||||||
"finalhandler": "=2.1.0",
|
"finalhandler": "=1.1.2",
|
||||||
"googleapis": "^154.1.0",
|
"googleapis": "^91.0.0",
|
||||||
"html-to-text": "=9.0.5",
|
"html-to-text": "=5.1.1",
|
||||||
"irc": "=0.5.2",
|
"irc": "=0.5.2",
|
||||||
"lokijs": "=1.5.12",
|
"lokijs": "=1.5.7",
|
||||||
"mkdirp": "=3.0.1",
|
"mkdirp": "=0.5.5",
|
||||||
"morgan": "=1.10.1",
|
"morgan": "=1.9.1",
|
||||||
"node-cron": "^4.2.1",
|
"node-cron": "^2.0.3",
|
||||||
"node-dev": "^8.0.0",
|
"node-dev": "^7.1.0",
|
||||||
"node-uuid": "=1.4.8",
|
"node-uuid": "=1.4.8",
|
||||||
"promise": "=8.3.0",
|
"promise": "=8.0.3",
|
||||||
"request": "=2.88.0",
|
"request": "=2.88.0",
|
||||||
"request-promise": "=4.2.4",
|
"request-promise": "=4.2.4",
|
||||||
"twitter": "=1.7.1",
|
"twitter": "=1.7.1",
|
||||||
"winston": "=3.17.0",
|
"winston": "=3.2.1",
|
||||||
"winston-daily-rotate-file": "^5.0.0"
|
"winston-daily-rotate-file": "^3.10.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"nodemon": "^3.1.10"
|
"nodemon": "^2.0.15"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,22 +3,22 @@ var requestPromise = require('./helpers/requestPromise.js')
|
|||||||
var BasePlugin = require('./base.js')
|
var BasePlugin = require('./base.js')
|
||||||
var htmlToText = require('html-to-text')
|
var htmlToText = require('html-to-text')
|
||||||
class Mastodon extends BasePlugin {
|
class Mastodon extends BasePlugin {
|
||||||
constructor(config) {
|
constructor (config) {
|
||||||
super(config)
|
super(config)
|
||||||
this.name = 'Mastodon'
|
this.name = 'Mastodon'
|
||||||
}
|
}
|
||||||
|
|
||||||
test(input) {
|
test (input) {
|
||||||
if (input.match(/http(s)?:\/\/(www\.)?((.*\..*\/users\/([a-zA-Z0-9_-]*)\/statuses\/([0-9_-]*)))$/)) {
|
if (input.match(/http(s)?:\/\/(www\.)?((.*\..*\/users\/([a-zA-Z0-9_-]*)\/statuses\/([0-9_-]*)))/)) {
|
||||||
return true
|
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 true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
getToot(host, statusId) {
|
getToot (host, statusId) {
|
||||||
var promise = new Promise(function (resolve, reject) {
|
var promise = new Promise(function (resolve, reject) {
|
||||||
var url = 'https://' + host + '/api/v1/statuses/' + statusId
|
var url = 'https://' + host + '/api/v1/statuses/' + statusId
|
||||||
requestPromise(url, {}, {
|
requestPromise(url, {}, {
|
||||||
@ -49,7 +49,7 @@ class Mastodon extends BasePlugin {
|
|||||||
return promise
|
return promise
|
||||||
}
|
}
|
||||||
|
|
||||||
result(input) {
|
result (input) {
|
||||||
var that = this
|
var that = this
|
||||||
var resultPromise = new Promise(function (resolve, reject) {
|
var resultPromise = new Promise(function (resolve, reject) {
|
||||||
var host = null
|
var host = null
|
||||||
|
@ -177,7 +177,7 @@ class Weather extends BasePlugin {
|
|||||||
|
|
||||||
var windspeed = result.wind.speed
|
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)
|
resolve('Sää: ' + str)
|
||||||
}
|
}
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user