Console:
Twitter (thx for the follow 😀):
$ npm install
You need to install nodejs version 16.x.x
or higher.
Check your version:
$ node --version
Go to Twitter for Developers and sign up to developer account.
Fill out the pages with information.
Go to Developer Portal then click on the Projects & Apps
menu.
Select or create your project, then create an App.
If your created it, click on it and navigate to the Keys & Tokens
tab.
You will see this:
At Consumer Keys click on the Regenerate
button, then click on Yes, regenrate
.
API Key
= CONSUMER_KEY
API Key Secret
= CONSUMER_SECRET
Rename .env.EXAMPLE
to .env
then paste the keys into it:
CONSUMER_KEY=key
CONSUMER_SECRET=key
You got back to the previous page. Now generate Access Token and Secret for user.
Access Token
= ACCESS_TOKEN
Access Token Secret
= ACCESS_TOKEN_SECRET
Save your keys into .env
:
ACCESS_TOKEN=key
ACCESS_TOKEN_SECRET=key
Two functions in the comment at the bottom of the index.ts file.
run({ onlyOnce: true }); // set true or false (read more in index.ts)
runDaily(); // the run function but repeated every 24 hours automatically
Remove the comment from the ones you want to use.
Run the script with this command:
$ ts-node index
If not working, use this:
$ npm install ts-node typescript -g
meta.hint.js
in data
folder before doing anything.
You can put any image or video into the data
folder.
After putting the files, you need to assign manually the files to descriptions and other options in meta.json
.
Some example:
// text with poll
{
"files": [],
"text": "👋🏻 Hey there! Check out my new pic",
"poll": {
"duration": 120,
"options": ["Selection A", "Selection B", "Selection C", "Selection D"]
},
"isTweeted": false
}
// text with media
{
"files": ["index.jpg"],
"text": "👋🏻 Hey there! Check out my new pic",
"isTweeted": false
}
// only media
{
"files": ["video.mp4"],
"text": "",
"isTweeted": false
}
// only text
{
"files": [],
"text": "👋🏻 Hey there! Check out my new pic",
"isTweeted": false
}
// text with linebrakes
{
"files": [],
"text": "👋🏻 Hey there!\n\n#helloworld\nthis is another line", // multiline supported: \n for linebreak
"isTweeted": false
}
if you have any questions, just open an issue here: Issues 100% not a rick roll