I created a Bot that will help you buy Doge or BTC based on Elon Musk’s tweet
Tags: twitter, elonmusk, doge
Published: 2021-03-11 12:01:38

---
title: I created a Bot that will help you buy Doge or BTC based on Elon Musk’s tweet
published: true
description: 
tags: twitterapi,elonmusk,doge
cover_image: https://cdn-images-1.medium.com/max/2048/1*UyiGGFtUlKx1PP5BdrNcHg.png
canonical_url: https://medium.com/coinmonks/i-create-bot-that-help-your-buy-doge-or-btc-after-elon-musk-made-tweet-e0fddcf7a54e
---

Now, we do not need to wait for Elon Musk to tweet something. We are especially waiting for Elon Mush to tweet about some crypto-currency or company so that its value goes up in the market.

Why don’t we create a bot that will analyze Elon Musk’s tweet and inform us about the tweet?

The bot is fairly simple. There are two sides: server-side and client-side.

The server-side works in active mode. It monitors Elon Musk’s tweet and sends the buy signal to the client when detecting the tweet containing some hint of Doge or Bitcoin word.

The client-side works in passive mode. It waits for the signal from the server on Doge or Bitcoin so that the client can analyze the info. Then finally, the client can decide on which coin to buy.

The exact interpretation of the client and server-side is demonstrated in the flow image below:

![](https://cdn-images-1.medium.com/max/3840/1*L6Lh9YWOG7T10WN-73CkmQ.png)

### Limitation…

For now, there is only support for Binance which is for people in the US.

Please subscribe to this email list and sign up to [Gate.io](https://www.gate.io/signup/3265513) or [Coinbase ](http://coinbase-consumer.sjv.io/gbbRm2)using my referral link.

## Roadmap

 1. Detect only Doge or Bitcoin words from the tweets. ( **already done** )

 2. Buy in the Future market. ( **not done yet **)

 3. Detect Doge and Bitcoin logo from the tweet image. ( **on the way on train model**)

 4. Perform sentiment analysis on the stock. only for people located in the USA that can use [Alpaca ](https://alpaca.markets/)or [Robinhood](https://robinhood.com/). ( **also not start yet that feature benefit only people in the USA may be kept on a paid plan**)

## If you have any Queries…

You can join our [Facebook group](https://www.facebook.com/groups/261805308872238\) and ask.

Now, if you want to start implementing the bot then follow the instructions provided in the steps below:

## Setup Server for Client

In order to run the bot on a server, we require a cheap server. For that, I recommend [Cloudways](https://www.cloudways.com/en/?id=74316&elonbot_promo=signup) because they provide a 10$/Month VPS server.

The pricing plan is shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2344/1*xsCPdBGrOTQMwGt3lKSSeA.png)

First, we need to go to the registration page to sign up as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*OQkskIqJOzEMnhN6uRG7hw.png)

Then, we need to set the password as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*V9MZjPrTEBxv4fwBaWEMwA.png)

After successful signup, we will be redirected to the dashboard screen. In the dashboard, we need to change the fields specifying Your Application, Your Server, Your project as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2522/1*ki1S-JwLW_OaNXe-GRWkFA.png)

Then, w need to pick the Laravel as a server application as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2276/1*ThaDTWTWklWMimk5BSy3Ig.png)

Now to create a new server instance, we need to pick the server size and location as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*IdZdUismJPcioZMnVYQ-yQ.png)

Here, we can see how much we get charged hourly and monthly.

Next, we simply need to click on the **LAUNCH NOW **button as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2534/1*jXVRHCIVHiHPrcUOyV6Olg.png)

The launch operation will take some time. Hence, we may need to wait for around 5 minutes for the setup process to complete:

![](https://cdn-images-1.medium.com/max/2300/1*B-FGpCZmHI_uPmVaFA7IYQ.png)

After successful setup, we will get access to the server dashboard as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2286/1*H9FhVq6_JGAFgKQQyiOsKA.png)

Next, we need to go to the **Setting & Package** menu and select the **Advanced** tab as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*QfBzlwxw-zztRlaYbPcBAA.png)

Now, we need to scroll down the same tab and enabled the **Access Application VIA IP **as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*jHNeAMVNfgVq045uk6Xc-w.png)

Lastly, we need to **SAVE CHANGES **as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*vylg_rCG3ziHdxgR5FjATg.png)

Now, we need to go to set up our BOT. For that, we need to go to the **Applications **tab as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*eOS4L5d1-gc9KdloFM_0wg.png)

We can see our blank app below:

![](https://cdn-images-1.medium.com/max/2312/1*lEO1IQYgCKtNoVulSY4HKg.png)

Now, we need to go to **Deployment via Git **from the sidebar as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2272/1*NL-U9KMsk9_EecuNSLZHKA.png)

Here, we need to click on **GENERATE SSH KEY **as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*FLe3WzbFJEJ1DKMotodv2g.png)

### Register on GitHub to auto-update the bot

For this tutorial, I chose to host source code on GitHub. It will make the server easier to upgrade.

Also, make sure that you have a GitHub account. If you don’t, you can go ahead and Sign up as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2522/1*VetbyTMRA6WI83yALRtdNg.png)

The registration process is simple in GitHub, we just need to fill the credentials as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*mFbR_XPTZLtmnG3IkhrGIw.png)

After successful registration with an email, we need to go to account settings and navigate to **SSH and GPG keys** tab as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2126/1*1Mk82WlZqsGqYCyqPsuruA.png)

Then, we need to hit the **New SSH key **as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2254/1*ktC6tCmiZJXQGemy6fgSWA.png)

Now we need to come back to Cloudways and click on the **View SSH KEY **tab. Here, we can get the SSH key and add it to GitHub. The exact location to get the key is shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*eH5hcl44vNcxGhz70B4Bag.png)

From the SSH KEY dialog, we need to copy the SSH KEY:

![](https://cdn-images-1.medium.com/max/2000/1*19qvrb_DXP4udtCoFESKhg.png)

And then, we need to paste the SSH key to GitHub as shown in the image below:

![](https://cdn-images-1.medium.com/max/2000/1*D5_pfUZTiVzBpF5OySRAJA.png)

Next, we need to come back to Cloudways and add the bot URL to [git@github.com](mailto:git@github.com):krissnawat/elonbot_client.git.

Then, we need to hit the **PULL** button as directed in the image below:

![](https://cdn-images-1.medium.com/max/2000/1*gjh7o8bg_7Fe9oitBpo0xQ.png)

Now, if everything works fine then it means that the download was successful.

Now our next step is to set up the bot. For that, we need to have a Chrome extension called [Secure Shell App](https://chrome.google.com/webstore/detail/secure-shell-app/pnhechapfaindjhompbnflcldabbghjo/related?hl=en). We can simply search for it in google from Chrome browser and add it.

![](https://cdn-images-1.medium.com/max/2274/1*znv55hWM4Kk4q3cGGnrfgg.png)

After the successful installation, we can hit **Launch App **which will redirect us to the following screen:

![](https://cdn-images-1.medium.com/max/2302/1*UeysMe5RdXS9OQmI8vFVMw.png)

Here, we need to paste the username and Server IP address.

But first, we need to know where to get these credentials.

For that, we need to go to our app as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2430/1*VNOIBo0GJM8_JtaDFGbWJg.png)

If we navigate inside the app, we will see the credentials as highlighted in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*LoFeDlMdeDNYWXClDtu4gw.png)

For now, we can connect and access the inside server as shown in the terminal screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*mO-pxnYQxS1tMXtmNXf12g.png)

The terminal for the server is shown in the image below:

![](https://cdn-images-1.medium.com/max/2000/1*0ZIuBa4aqWGz4lwnLBzA7Q.png)

Now next quick thing is to run some commands in the terminal. We need to execute the **composer install.**

After the successful execution, we need to run **nano .env **command as shown in the terminal screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*3LHkz2eRjrjP6bT3SAwvCA.png)

Now inside the .env file, we need to update the database credential as highlighted in the image below:

![](https://cdn-images-1.medium.com/max/2000/1*DUCmkoMhpg380np1sQZYjA.png)

Now, we need to head back to Cloudways dashboard where we need to locate the DB Name, Username, Password. We just need to copy and replace in the .env file:

![](https://cdn-images-1.medium.com/max/2000/1*KhWTuk-DANNIKan9h23urQ.png)

When done, we need to hit CTRL+X to save as directed in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*bX_6GK0Q13cU6fbGQQglsA.png)

Next, we need to execute the command shown in the snippet below:

php artisan migrate --seed

The exact execution of the command in the terminal is shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*1xkdbnSwTg8IHZLUG3rXWw.png)

Hence, we have completed the installation for now. We can access our app with URL in the Cloudways dashboard:

![](https://cdn-images-1.medium.com/max/2000/1*Y1GspnrX9Xxf5NaqvGBi_Q.png)

If we navigate to the URL, we will be redirected to the login page. But first, we need to register as directed in the image below:

![](https://cdn-images-1.medium.com/max/2000/1*g_yyfHQ2sIRHDNrdH4AQ3Q.png)

We need to type in our credentials and hit the **REGISTER** button:

![](https://cdn-images-1.medium.com/max/2000/1*8Hx5GDOcPSr2vv_FkjjD_Q.png)

After successful sign-up, we need to perform the following task:

 1. Find and create an API key and Secret Key on Binance.

 2. Choose which coin that you need to buy.

 3. Start bot.

 4. Finally, we need to prepare USDT in the Binance wallet.

![](https://cdn-images-1.medium.com/max/3820/1*WB21T2hnnZyKKUtYgMu2_A.png)

## Creating Binance API key

First, we need to go to the Binance API Management page as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*l4JspVmr1F-2BXxCQOYWAw.png)

Then, we need to fill the key label as directed in the image below:

![](https://cdn-images-1.medium.com/max/2162/1*594i_N-5YDWpz-FRRwH44A.png)

For security verification, you can use your own credentials:

![](https://cdn-images-1.medium.com/max/2000/1*kPguGgNhDeBhmlL2yMOntA.png)

Then, we will get the key as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2052/1*rmBEy-LQK_oAceZ_VnOPEQ.png)

### Activate 2FA for secure our bot

In this step, we are going to activate the 2-factor authentication service to secure our bot.

For that, we need to head to the Profile tab as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2042/1*jTPkE1lr0Ln_e9MuXmpw1A.png)

Then, we need to enable the 2FA by hitting the **ENABLE** button:

![](https://cdn-images-1.medium.com/max/2732/1*eoBRXptOqbRf-F44zb2gJg.png)

To enable, it will ask you for your password which you can enter and hit the **CONFIRM** button:

![](https://cdn-images-1.medium.com/max/2000/1*5z3QDiVLEtXLHbIfpBwnBw.png)

Here, we must make sure not to forgot to save our recovery code for using Google Authenticator:

![](https://cdn-images-1.medium.com/max/2616/1*oZQoIdbdZZFpEw2erx9jfw.png)

Now in order to log in, we will need to perform 2-factor authentication as shown in the screenshot below:

![](https://cdn-images-1.medium.com/max/2000/1*F5sOEb2ZrpFKoM4APqLj_Q.png)
> # Join Coinmonks [Telegram group](https://t.me/joinchat/EPmjKpNYwRMsBI4p) and learn about crypto trading and investing

### Also, Read

* The Best [Crypto Trading Bot](https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a)

* [Bitcoin exchange in India](https://medium.com/coinmonks/bitcoin-exchange-in-india-7f1fe79715c9)

* [Bitcoin Savings Account](https://medium.com/coinmonks/bitcoin-savings-account-e65b13f92451)

* The Best [Crypto Tax Software](https://medium.com/coinmonks/best-crypto-tax-tool-for-my-money-72d4b430816b)

* [Grid Trading](https://blog.coincodecap.com/grid-trading)

* [Best Crypto Exchange](https://medium.com/coinmonks/crypto-exchange-dd2f9d6f3769)