From 5c30acb191b5d80c1bd880e30f5adf99777e7c79 Mon Sep 17 00:00:00 2001 From: ale Date: Sat, 24 Aug 2019 12:42:27 +0000 Subject: [PATCH] account --- follow.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/follow.js b/follow.js index 5cd572a..a916a2e 100644 --- a/follow.js +++ b/follow.js @@ -1,14 +1,18 @@ 'use strict' const requestsync = require('sync-request'), - url = process.argv[2] || 'https://user:pass@social.hatthieves.es' + user = process.argv[2] || 'user', + pass = process.argv[3] || 'pass', + site = process.argv[4] || 'https://social.hatthieves.es', + url = site.split('://')[0] + '://' + user + ':' + pass + '@' + site.split('://')[1] try { let actors, followed = [], - count = 100 + count = 100, + account = JSON.parse(requestsync('GET', url + '/api/v1/accounts/' + user).getBody()).id do { let id = actors && actors.length > 0 ? actors[actors.length - 1].id : '', - body = requestsync('GET', url + '/api/v1/accounts/9lM7CeFGQNLWp38fgW/following?max_id=' + id + '&limit=' + count) + body = requestsync('GET', url + '/api/v1/accounts/' + account + '/following?max_id=' + id + '&limit=' + count) try { actors = JSON.parse(body.getBody()) if (actors && actors.length > 0) {