From 0f0322c8cee67a2a45d3bffc3e4d0c5530ec7cd7 Mon Sep 17 00:00:00 2001 From: myk bilokonsky Date: Mon, 10 Apr 2017 01:41:36 +0200 Subject: actually wiring up the api now --- index.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 68facd4..d7f2f33 100644 --- a/index.js +++ b/index.js @@ -52,8 +52,19 @@ var M = new mastodon({ var boosted = {}; function boost(rows) { - console.log('Boosting the following:'); - console.dir(rows); + rows.map(function(row) { + return row.id; + }) + .filter(function(id) { + return !boosted[id]; + }) + .forEach(function(id) { + M.post(`/api/vi/statuses/${id}/reblog`, function(err, result) { + console.log(`boosted status #${id}`); + console.log('error:', err); + console.log('result:', result); + }); + }) } cycle(); -- cgit