Automate your Twitter. Endlessly.
- Send a sweet ThankU message to a person who followed you.
- 'Everyday Trend' Tweeter (Eg. #MondayMorning, #FridayFeeling)
Have you seen a #MondayMotivation or a #FridayFeeling tweet with a random proverb above? You might be doing it by copying proverbs and pasting it in twitter composer. But now, Bot does it for you everyday!
Git will be useful for you as well as for Glitter bot to work efficiently. Install Git Command Line tools here.
- To sign up at Firebase, you need a Gmail account.
- Head over to the Firebase console, and click add Project
- Write your project name like this:
glitter-bot-<yourname>
and click Create project - Once you reach dashboard, Head Over to the settings icon at the top left and click
Project Settings
. - Go to the Service Accounts tab and then click
Generate new private key
button. This should download a file. Rename that file toglitter.json
and you're done with Firebase.
- Download all the files to your local machine by directly downloading the zip file from this GitHub repo.
- Unzip the files and change the folder name from
glitter-master
toglitter-<yourname>
. - Once you downloaded the files, open
Terminal
if you are on Mac and if you use Windows, use theGit bash
that you downloaded in Step 1. - Once you open Terminal, enter into the project file:
$ cd glitter-<yourname>
. The command depends on your current folder location. If you don't know how to use terminal, you may need to learn small tit-bits on internet.
- Go to Twitter App Manager
- Create your new app and let the App name be:
glitter-bot-<yourname>
- Once your app is created, go to the Keys and Access Token tab.
- If you see only 2 Consumer keys, you need to generate Access keys too...
- Under the same tab, find for a button which says
Change App Permissions
. Change the app permission toRead, Write and Direct Message
. - From the downloaded project, enter the API keys in
src/config.js
file.
{
consumer_key: '...',
consumer_secret: '...',
access_token: '...',
access_token_secret: '...'
}
- After you are ready with your API keys pasted in the
config.js
, head over to next step.
- Log on to zeit.co. We'll be using their product (now.sh) for deployment.
- Install
now
.
$ npm i -g now
- In the
src
folder, opensettings.js
and change the YOUR_NAME and YOUR_TWITTER_HANDLE property.
YOUR_NAME: 'my name goes here', // Eg. Steve Jobs
YOUR_TWITTER_HANDLE: 'my twitter handle goes here', // Your Twitter handle (without @)
- In
src/settings.js
change theDATABASE
property to the app name that you inserted in Firebase. In your case, it might beglitter-bot-<yourname>
.
DATABASE: 'glitter-bot-<yourname>' // App name that you inserted while creating project at Firebase
- In the same file, you will find settings for sending ThankU message when someone follows you. Keep
FOLLOW_ENGAGER_STATUS_DM
ON if you want to send Thank You message in form of a direct message. And.. KeepFOLLOW_ENGAGER_STATUS_TWEET
ON if you want to send Thank You message in form of a public mentioned Tweet.
// When someone follows
// Engager bot for DM after follow
FOLLOW_ENGAGER_STATUS_DM: 'ON', // Keep it OFF if you don't want this bot to automatically DM someone who followed you. Else, turn it ON.
FOLLOW_THANK_U_NOTE_GREET: "Hi,", // Result: Hey, <name-of-person-who-followed>!
FOLLOW_THANK_U_NOTE_MSG: "Thanks for following me on Twitter. :) I use #GlitterBot for automating my Twitter account. When will you? https://github.com/KumarAbhirup/glitter",
// Engager bot for Thank You Tweet after follow
FOLLOW_ENGAGER_STATUS_TWEET: 'OFF', // Keep it OFF if you don't want this bot to automatically Mention-Tweet someone who followed you. Else, turn it ON.
FOLLOW_THANK_U_TWEET_GREET: "Hey,", // Result: Hey, @<screen-name-of-person-who-followed>...
FOLLOW_THANK_U_TWEET_MSG: "Thanks for following me on Twitter.",
- If you want to tweet everydayTrends with relevant proverbs and hashtags, keep
EVERYDAY_TRENDER
insettings.js
ON. You can also edit and change the hashtags for every day of the week...
// Everyday Hashtags
MONDAY: "#MondayMotivation #MondayMorning #MusicMonday",
TUESDAY: "#TuesdayMotivation #TuesdayThoughts",
WEDNESDAY: "#WednesdayWisdom #WonderfulWednesday",
THURSDAY: "#ThrowbackThursday #ThankfulThursday",
FRIDAY: "#FridayFeeling #FollowFriday",
SATURDAY: "#SaturdaySpirit #Saturday",
SUNDAY: "#SundayFunday",
- Remember the
glitter.json
file that you downloaded in Step 2? Copy and Paste that file to the root of this project folder. - And you are almost done with your bot!
- Just type this in terminal:
$ now
- It will ask you for an email. Enter the email you provided while creating your Zeit account. Once entered, you many need to visit your Email Client and verify yourself.
- Then you need to get the Deployment URL. For that... write in the terminal
$ now ls
and then copy the url of the app you deployed. - Then you need to scale your app so that the Twitter bot will work forever.
$ now scale <copiedDeploymentUrl> sfo 1
- And you are done! The copied Deployment Url is where your bot is located!
- All this was just a setup. THE REAL STUFF HASN'T YET STARTED!
To do this, change and set texts as per your desire in settings.js
. If you want to change the account on which bot will function, you need to change APP CONFIG keys in config.js
.
Once you make all your changes,
hit these commands in your Terminal...
$ now ls
When you do this, you'll see your latest deployments. Just copy/grab the deployment-url of the latest glitter deployment and hit this command:
$ now rm <copied-deployment-url>
$ now
$ now scale <newDeploymentUrl> sfo 1
By doing this, you are ensuring that no other bot is controlling your account other than your latest fresh Twitter bot.
And that's it! Future Glitter updates will surely have some more automation and will make tasks easier for you :-)
Bot stopped working due to Account lock: This is a common problem faced by many users. When your account gets locked, you should unlock the account by verifying Mobile number or Email id and then change the password.
Invalid or Expired token: (Always faced after changing password) This error comes after few hours of you changing your password. This is because when you change password, the Twitter API access keys get changed. Solution:
- Generate the Consumer keys and Access Tokens again in the Twitter App manager
- Now, Regenerate the Access token keys after you generate them again
- If you haven't changed App Permissions to
Read, Write and Direct Message
, do that now. - From the downloaded project, enter the NEW API keys in
config.js
file.
{
consumer_key: '...',
consumer_secret: '...',
access_token: '...',
access_token_secret: '...'
}
- After you changed all the tokens and keys, deploy again. (Scroll above to learn how to deploy bot for the second time)
This software is free to use. Enjoy glittering!
If you experience any kind of bug, do let me know... will improve this bot together. Thank you.