summary refs log tree commit diff
diff options
context:
space:
mode:
authormyk bilokonsky <mbilokonsky@gmail.com>2017-04-10 01:41:36 +0200
committermyk bilokonsky <mbilokonsky@gmail.com>2017-04-10 01:41:36 +0200
commit0f0322c8cee67a2a45d3bffc3e4d0c5530ec7cd7 (patch)
tree633c8bf012900638f95b06a4db4c1fbb5153ffe7
parent5b886f9dc093d2133dc0a8a414bdde7be5df7cc6 (diff)
actually wiring up the api now
-rw-r--r--index.js15
1 files 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();