Syfol is a script that allows any Twitter user to gain followers by temporarily following others.
- [x] Follows users posting tweets matching specified search criteria
- [x] Adheres to Twitter's rate limiting
- [x] Skips any users that have been followed before
- [x] Configurable limits, see config
- [x] Never crashes, all exceptions caught
- [ ] Distribute (un)follows over time for a better relationship with Twitter's rate limiting AI
- [ ] Automatically retrieve new access tokens on expiry
- [ ] Slack integration (status updates, work done, change params)
- [ ] Fully-managed cloud service for the less technical
Syfol can be used as a NPM package but is designed primarily to be used as a script. See NPM usage below.
- Clone the repo
- Run
npm install
inside the directory - Run
npm build
inside the directory - Add your env file (see config below)
- Execute the
dist/script.js
file (forever or PM2 is recommended)
Logging is done by the debug module. To see the logs, change the DEBUG
parameter when executing the script. The best options are DEBUG=*
and slightly less verbose DEBUG='syfol:main'
. The debug module will then log to stderr
.
Configuration is done via an env file. The default configuration path is ~/.syfol
but this can be changed by setting the ENV_PATH
global. Ensure the path is absolute.
This is an example file minus API keys which you need to get from Twitter.
SEARCH_QUERY='candy' # The query for the search
BATCH_INTERVAL=3600000 # The interval between batches
BATCH_QUANTITY=50 # Users to follow per batch
FOLLOW_PERIOD=21600000 # Period of time to follow a user
FOLLOWER_LIMIT=500 # Max following count from syfol
EXCLUDE_USERS='12,775,6231,4' # User IDs to exclude
TWITTER_CONSUMER_KEY=''
TWITTER_CONSUMER_SECRET=''
TWITTER_ACCESS_TOKEN_KEY=''
TWITTER_ACCESS_TOKEN_SECRET=''
You can also use this module as an NPM module although there is very little functionality.
Install from npm
npm install syfol
Then use in code in the following way:
import { setup, cancel, changeEnvPath } from 'syfol'
/* Setup env variables */
// via a file at ~/.syfol
// or via a file at a different path
changeEnvPath('/Users/user/path/to/syfol.env')
// or set manually
process.env.KEY_NAME = 'some value'
/* Enable debugging / logging */
// optionally set `DEBUG` variable to see logs
process.env.DEBUG = '*' // or 'syfol:main'
/* Start by calling setup() */
setup()
/* End by calling cancel() */
setTimeout(cancel, 86400 * 1000) // ends after one day