kumarabhirup / glitter

Automate your Twitter. Endlessly.
https://github.com/KumarAbhirup/glitter
6 stars 0 forks source link

Code: 89 | Invalid or Expired token #3

Closed kumarabhirup closed 6 years ago

kumarabhirup commented 6 years ago

The API keys and tokens get expired every now and then. This is a major issue making this bot not work at all after an interval of few hours.

Error messages:

2018-05-20T07:17:54.530088+00:00 app[unfollowUnfollower.1]: { Error: Invalid or expired token.
2018-05-20T07:17:54.530088+00:00 app[unfollowUnfollower.1]: at Object.exports.makeTwitError (/app/node_modules/twit/lib/helpers.js:74:13)
2018-05-20T07:17:54.530090+00:00 app[unfollowUnfollower.1]: at onRequestComplete (/app/node_modules/twit/lib/twitter.js:328:25)
2018-05-20T07:17:54.530091+00:00 app[unfollowUnfollower.1]: at Request.<anonymous> (/app/node_modules/twit/lib/twitter.js:348:7)
2018-05-20T07:17:54.530092+00:00 app[unfollowUnfollower.1]: at emitOne (events.js:121:20)
2018-05-20T07:17:54.530094+00:00 app[unfollowUnfollower.1]: at Request.emit (events.js:211:7)
2018-05-20T07:17:54.530095+00:00 app[unfollowUnfollower.1]: at Gunzip.<anonymous> (/app/node_modules/request/request.js:1085:12)
2018-05-20T07:17:54.530096+00:00 app[unfollowUnfollower.1]: at Object.onceWrapper (events.js:313:30)
2018-05-20T07:17:54.530097+00:00 app[unfollowUnfollower.1]: at emitNone (events.js:111:20)
2018-05-20T07:17:54.530098+00:00 app[unfollowUnfollower.1]: at Gunzip.emit (events.js:208:7)
2018-05-20T07:17:54.530099+00:00 app[unfollowUnfollower.1]: at endReadableNT (_stream_readable.js:1064:12)
2018-05-20T07:17:54.530101+00:00 app[unfollowUnfollower.1]: at _combinedTickCallback (internal/process/next_tick.js:138:11)
2018-05-20T07:17:54.530102+00:00 app[unfollowUnfollower.1]: at process._tickCallback (internal/process/next_tick.js:180:9)
2018-05-20T07:17:54.530103+00:00 app[unfollowUnfollower.1]: message: 'Invalid or expired token.',
2018-05-20T07:17:54.530104+00:00 app[unfollowUnfollower.1]: code: 89,
2018-05-20T07:17:54.530105+00:00 app[unfollowUnfollower.1]: allErrors: [ { code: 89, message: 'Invalid or expired token.' } ],
2018-05-20T07:17:54.530107+00:00 app[unfollowUnfollower.1]: twitterReply: { errors: [ [Object] ] },
2018-05-20T07:17:54.530108+00:00 app[unfollowUnfollower.1]: statusCode: 401 }

Let us do something of it. After a lot of efforts, the error fades away and then suddenly comes back.

kumarabhirup commented 6 years ago

This happens when Twitter detects any kind of wrong activities. In Glitter bot v1.0, Glitter aggressively followed and unfollowed people. If you check for the new versions, this problem is now solved because the Interval time is increased from 20 seconds to 180 seconds.