mirror of
https://gitlab.com/Oreolek/improv_forest.git
synced 2024-06-17 07:30:56 +03:00
Mastodon posting
This commit is contained in:
parent
efe0844b50
commit
eb847b7657
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
/node_modules
|
/node_modules
|
||||||
|
/config.cson
|
||||||
|
|
2
config.cson.example
Normal file
2
config.cson.example
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
access_token: "your-token-here"
|
||||||
|
api_url: "https://botsin.space/api/v1/"
|
12
main.coffee
12
main.coffee
|
@ -3,6 +3,13 @@ ImprovModel = require "./model"
|
||||||
fs = require 'fs'
|
fs = require 'fs'
|
||||||
CSON = require 'cson'
|
CSON = require 'cson'
|
||||||
glob = require 'glob'
|
glob = require 'glob'
|
||||||
|
Masto = require 'mastodon'
|
||||||
|
|
||||||
|
config = CSON.parseCSONFile('config.cson')
|
||||||
|
Mastodon = new Masto({
|
||||||
|
access_token: config.access_token
|
||||||
|
api_url: config.api_url
|
||||||
|
})
|
||||||
|
|
||||||
files = glob.sync('data/*.cson')
|
files = glob.sync('data/*.cson')
|
||||||
spec = {}
|
spec = {}
|
||||||
|
@ -28,4 +35,7 @@ improv = new ImprovEngine(spec, {
|
||||||
})
|
})
|
||||||
|
|
||||||
model = new ImprovModel
|
model = new ImprovModel
|
||||||
console.log improv.gen('description', model).trim()
|
description = improv.gen('description', model).trim()
|
||||||
|
Mastodon.post('statuses', {
|
||||||
|
status: description
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in a new issue