Compare commits
3 Commits
373c883027
...
e5f83ec639
Author | SHA1 | Date | |
---|---|---|---|
e5f83ec639 | |||
5495549464 | |||
960e43ac9b |
4884
package-lock.json
generated
4884
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"
|
||||
},
|
||||
"dependencies": {
|
||||
"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",
|
||||
"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",
|
||||
"irc": "=0.5.2",
|
||||
"lokijs": "=1.5.7",
|
||||
"mkdirp": "=0.5.5",
|
||||
"morgan": "=1.9.1",
|
||||
"node-cron": "^2.0.3",
|
||||
"node-dev": "^7.1.0",
|
||||
"lokijs": "=1.5.12",
|
||||
"mkdirp": "=3.0.1",
|
||||
"morgan": "=1.10.1",
|
||||
"node-cron": "^4.2.1",
|
||||
"node-dev": "^8.0.0",
|
||||
"node-uuid": "=1.4.8",
|
||||
"promise": "=8.0.3",
|
||||
"promise": "=8.3.0",
|
||||
"request": "=2.88.0",
|
||||
"request-promise": "=4.2.4",
|
||||
"twitter": "=1.7.1",
|
||||
"winston": "=3.2.1",
|
||||
"winston-daily-rotate-file": "^3.10.0"
|
||||
"winston": "=3.17.0",
|
||||
"winston-daily-rotate-file": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.15"
|
||||
"nodemon": "^3.1.10"
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -177,7 +177,7 @@ class Weather extends BasePlugin {
|
||||
|
||||
var windspeed = result.wind.speed
|
||||
|
||||
let str = 'Sää: ' + city + ', ' + country + ' (' + temp + ' °C, ' + that.iconCodeToText[code] + ', ilmankosteus: ' + humidity + ' %, ilmanpaine: ' + pressure + ' hPa, tuulen nopeus: ' + windspeed + ' m/s)'
|
||||
let str = city + ', ' + country + ' (' + temp + ' °C, ' + that.iconCodeToText[code] + ', ilmankosteus: ' + humidity + ' %, ilmanpaine: ' + pressure + ' hPa, tuulen nopeus: ' + windspeed + ' m/s)'
|
||||
resolve('Sää: ' + str)
|
||||
}
|
||||
}, function (error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user