How To: Tweem - Automatically Tweet Steem Posts to Twitter

Words
487
Reading
3 min
Listen
Play
8y

alt

Are you looking for a way to tweet your Steem posts automatically? Maybe you are a part of a community and want to help your community's content have more exposure or perhaps onboard new users? You can with this great bot that was developed by ragepeanut@ragepeanut.
https://github.com/RagePeanut/Tweem

Requirements

  • Mac or Linux OS( If using Linux, Ubuntu 16.04 Recommended)

  • Twitter account

  • Optional: Install Linux Subsystem for Windows 10

Step 1

First, we are going to install the required libraries needed for this bot.

Ctrl+Shift+c to copy

Ctrl+Shift+v to paste in terminal
or
Right-click in the terminal if using Linux subsystem on Windows.

Note: If using Linux subsystem on Windows, the clipboard might not have copied properly so you might need to copy again and paste.

  • Open the Terminal

Copy & Paste into Terminal

sudo apt-get update && 
sudo apt-get install git -y && 
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh -o install_nvm.sh && 
bash install_nvm.sh && 
source ~/.profile && 
nvm install 8.11.3 && 
nvm use 8.11.3 && 
git clone https://github.com/RagePeanut/Tweem.git && 
cd Tweem/ && 
npm install && 
npm install pm2 -g

alt

Press ENTER (You may need to enter your Linux password you created when installing the OS. Note: Password not visible when you type.)

Step 2

Type the command:

sudo nano config.json

Edit here:

alt

    "steem_accounts": {
        "posts": [
            "ACCOUT_USERNAME",  <---- ADD ACCOUNTS
            "ACCOUT_USERNAME2",
            "ACCOUT_USERNAME3"
        ],
        "resteems": [
            "ACCOUT_USERNAME"  <---- LEAVE BLANK "" IF NOT USING
        ]
    },
    "stream_nodes": [
        "https://rpc.buildteam.io",
        "https://rpc.steemviz.com",
        "https://steemd.minnowsupportproject.org"
    ],
    "tweet_retry_timeout": 10000,
    "twitter_handle": "YOUR_TWITTER_ACCOUNT"
    }

After done editing your config.json file,

Press Ctrl+x then y

alt

Then ENTER

alt

Step 3

Go to the following page and get your Twitter API keys:

Log into your account on Twitter then visit the https://apps.twitter.com/ page and click on Create New App. Follow the steps until your bot is set up. Go on your bot's app page (not its public Twitter page, the one from your apps panel), click on Permissions then make sure Read and Write is selected under the Access title and click on the Update Settings button. Now click on Keys and Access Tokens, scroll down to the Token Actions subtitle and click on the Generate My Access Token and Token Secret button.

alt

alt

Step 4

Go back to the Terminal and edit the app.js file by typing:

sudo nano app.js

Set your own keys
You will come across some process.env.SOMETHING fields in the app.js file. If you plan on deploying this bot ONLY locally, you can replace them with your app's keys. You can find all the required keys on the Keys and Access Tokens page. However, if you plan on deploying it online you MUST protect those keys. The app uses environment variables to achieve that but you are free to use any other way as long as it's secure. I recommend using Heroku if you want to deploy this bot easily and freely.

To run locally:

Edit the following area and input your API keys between apostrophes like so: 'YOUR_TWITTER_API_KEY'

The "access_token" includes the dash -

alt

Press Ctrl+x then y, then ENTER

Step 5

Then type command to start bot:

pm2 start npm --name YOUR_NAME_PREFERENCE -- start (I used "Tweem" in YOUR_NAME_PREFERENCE)

alt

You can check to see if the script is running in the live logs by typing:

pm2 logs YOUR_NAME_PREFERENCE

alt

Ctrl+c to Exit

Once everything looks good, you're done! If everything was configured properly, you should see the Steem posts automatically tweeted on your Twitter account.

More information on how to use PM2 Here:
http://pm2.keymetrics.io/



Steemit Blog       Discord Server

How To: Tweem - Automatically Tweet Steem Posts to Twitter | Ecency