How To: Tweem - Automatically Tweet Steem Posts to Twitter

in #steem6 years ago

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.
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

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:

    "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

Then ENTER

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.

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 -

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)

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

pm2 logs YOUR_NAME_PREFERENCE

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

Sort:  

Better explained than I could ever have, thanks for this amazingly well made tutorial and for spreading the word about Tweem! I will come back to this post for the next few days to make sure that I'm not missing any interesting question or suggestion.

I tried my best :)

Thank you for developing such a great tool! It has definitely helped me with lightening my workload, onboard new users on the platform, and building some great new relationships.

I did have 1 small suggestion or question, would it be possible to impliment a way to set the frequency of how often the bot will post to Twitter? I was trying to control how frequent it posts to twitter since I have a few users added in the list.

That's a great suggestion, just added it to my to-do list. I've actually already worked on a similar feature for the @checky bot so it shouldn't be hard to implement. However, I won't be able to work on it until mid-September because I'm currently passing my exams.

That is a very cool thing to use, especially if you are running a community account, is it possible to make it post posts that acc resteemed or that should be done manually? and if there is a way to do it also on other platforms, like FB?

Anyhow great post @bitcoinparadise !

The "resteems" array in the "steem_accounts" part of config.json is made exactly for that purpose, any user put in that array that resteems a post will make you tweet that post. As for sharing on Facebook, it's planned but not yet implemented. You can see the live to-do list of this project here (currently inactive due to exams): https://github.com/RagePeanut/Tweem/projects/1

Thanks for your answer. Great way to get visibility on other platforms for community and personal content. Looking forward to updates!

Very good tool, with great utility. @bitcoinparadise will you know if it works for distributions based on Arch Linux?
Good vibes and thanks to @ragepeanut

a very useful steem program,i support the program,success is always @bitcoinparadise

Yes, it has been very useful indeed!

Thank you friend..!