Commit dcef4f62 authored by Effy Elden's avatar Effy Elden
Browse files

Initial commit of TootTime

parents
var Mastodon = require('mastodon');
var Schedule = require('node-schedule');
var Moment = require('moment-timezone');
var tootInterface = new Mastodon({ access_token : process.env.ACCESS_TOKEN });
function doTheToot() {
var now = Moment();
console.log(now);
var hours = now.tz(process.env.TIMEZONE).hour();
var toots = '';
for (var i = 0; i < hours; i++) {
toots += "TOOT ";
}
tootInterface.post('statuses', { status: toots });
}
var tooter = Schedule.scheduleJob('0 * * * *', doTheToot);
{
"name": "toottime",
"version": "0.1.0",
"description": "Mastodon bot that toots the time",
"main": "bot.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Effy Elden <dev@effy.is>",
"license": "MIT",
"dependencies": {
"mastodon": "^1.0.0",
"moment-timezone": "^0.5.11",
"node-schedule": "^1.2.0"
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment