How to Create First Steemit Bot

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@naya001·
0.000 HBD
How to Create First Steemit Bot
<html>
<p><img src="https://steemit-production-imageproxy-thumbnail.s3.amazonaws.com/DQmVKD26BBSZTuc7FdCSYipNTyiUeTqCPrqQfFnrR4cW1pP_1680x8400" width="1680" height="1260"/></p>
<p>This instructional exercise will direct you on the most proficient method to begin making bots for Steemit. The&nbsp;</p>
<p>bot will be composed in HTML and JavaScript so you DO NOT require a mind boggling web server or improvement condition. The greater part of this should be possible from an ordinary desktop or portable workstation phone a web program, content tool and the web. This guide ought to be anything but difficult to take after for an amateur web engineer. I am utilizing Windows 10, NotePad and Google Chrome, however any working framework (Mac/Linux) should work fine and dandy in the event that you can decipher.</p>
<p>&nbsp;Let's start by creating a folder on your desktop:&nbsp;</p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmPN38xzrjD2wcFu8898ahUcoRf436g258CopovGPkbXs9/image.png" width="86" height="101"/></p>
<p>Open this folder and create a file called “index.html” without the quotes.</p>
<p>Ensure you kill the choice "Conceal expansions for known record sorts " by following the headings at <em><strong>http://kb.winzip.com/kb/section/26/</strong></em>generally your "index.html" document will really be "index.html.txt" however the ".txt" will be covered up! This will keep your bot from executing.</p>
<p>&nbsp;You can create this file by right clicking then “New → Text Document” in the pop-up windows:&nbsp;</p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmUPzCRATZ5FPN4McLW53rEK1rLShpZhmUvbTUmLxprKve/image.png" width="665" height="467"/></p>
<p><br></p>
<p>&nbsp;The “index.html” file will contain code for your first steemit bot. You &nbsp;will need to open this file with Notepad by right clicking then “Open &nbsp;with → Choose another app” like in the following image:&nbsp;</p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmQ35WhcpgbGk8L4ia2HZMGbdTQTwAFdWanaxnKk7rds95/image.png" width="665" height="468"/></p>
<p><br></p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmUEo8RiU8WkYDQTvz7siWNXDPsWJoARBmrTUmJsiGYxz1/image.png" width="384" height="512"/></p>
<p><em><strong>&nbsp;code for your sample bot:&nbsp;</strong></em></p>
<p>&nbsp;</p>
<pre><code>&lt;html&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&lt;head&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script src="<a href="https://cdn.steemjs.com/lib/latest/steem.min.js">https://cdn.steemjs.com/lib/latest/steem.min.js</a>"&gt;&lt;/script&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;steem.api.getAccounts(['money-dreamer'], function(err, response){<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(err, response);<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/script&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&lt;/head&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&lt;body&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hello Steem!<br>
<br>
 &nbsp;&nbsp;&nbsp;&lt;/body&gt;<br>
<br>
&lt;/html&gt;<br>
<br>
</code></pre>
<p><em><strong>&nbsp;copy, then paste this code into NotePad and then save it.&nbsp;</strong></em></p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmNoSjn5obvRJoHTWCjfr25BnKqBDK7u4suWmLUVLKJoA8/image.png" width="915" height="493"/></p>
<p><em><strong>&nbsp;You can click it and it should open in your default browser. If not, &nbsp;right click then “Open with → Google Chrome” and then click your &nbsp;favorite browser such as Google Chrome.&nbsp;</strong></em></p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmdF5rmfzJwr1xJo9nduPkiGbuRutYu5g369FBVE5yaj7J/image.png" width="665" height="468"/></p>
<p><em><strong>&nbsp;Now that you have your bot opened in your web browser, you will need to &nbsp;open the developer tools by clicking the 3 circles on the top right of &nbsp;the page then clicking “More Tools → Developer Tools”. This will split &nbsp;the browser window into two panels.&nbsp;</strong></em></p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmeNpExB5KvTKaU2XNVH9cN1Djrk9FLi7EEa7EEtBv7AAD/image.png" width="546" height="453"/></p>
<p><em><strong>&nbsp;Click the “Console” tab in the “Developer Tools” panel like here:&nbsp;</strong></em></p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmRAXpqpc697pTvBJ27T9Y8yAbZsk5w8wQXm3k8yRLeXg3/image.png" width="855" height="293"/></p>
<p><em><strong>&nbsp;You will see the null → Array(1) text in the window. If not, refresh the &nbsp;page and it should be there. You can scroll through it to see all the &nbsp;data that is returned from the JavaScript call. Click the arrows on the &nbsp;left to open down a tree with all of the data returned. The code copied &nbsp;above contains my username “money-dreamer”, but you can replace it with &nbsp;you or anyone's screen name.&nbsp;</strong></em></p>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmbT7YuNdD8Q9C5SBDp2vXEHFhzKfD6XpWAQicV2FVQan6/image.png" width="976" height="777"/></p>
<p><em><strong>&nbsp;Now that we have the basics down, let's get the data to display on the &nbsp;web page. Copy and paste this code into the NotePad window for the &nbsp;“index.html” file.&nbsp;</strong></em></p>
<p>&nbsp;</p>
<pre><code>&lt;html&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&lt;head&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script src="<a href="https://cdn.steemjs.com/lib/latest/steem.min.js">https://cdn.steemjs.com/lib/latest/steem.min.js</a>"&gt;&lt;/script&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;script&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;steem.api.getAccounts(['money-dreamer'], function(err, response){<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//console.log(err, response);<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById("name").innerHTML = response[0]['name'];<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById("balance").innerHTML = response[0]['balance'];<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById("created").innerHTML = response[0]['created'];<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/script&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&lt;/head&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&lt;body&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hello &lt;span id="name"&gt;Steem&lt;/span&gt;!<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt;You have &lt;span id="balance"&gt;0 Steem&lt;/span&gt;.&lt;/div&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt;Your account was created on &lt;span id="created"&gt;2000-01-01T00:00:00&lt;/span&gt;.&lt;/div&gt;<br>
<br>
 &nbsp;&nbsp;&nbsp;&lt;/body&gt;<br>
<br>
&lt;/html&gt;<br>
<br>
</code></pre>
<p><img src="https://steemitimages.com/0x0/https://steemitimages.com/DQmPk6ydzKExstk1rLnTGw8WPpaR2wUdaSbiKnA8VQxPM9s/image.png" width="892" height="508"/></p>
<p>&nbsp;Find the documentation for more function calls here: <a href="https://steemit.github.io/steemit-docs/"><em><strong>https://steemit.github.io/steemit-docs/</strong></em></a><br>
Here is the steemit GitHub: <a href="https://github.com/steemit/steem"><em><strong>https://github.com/steemit/steem</strong></em></a><br>
Here is the steemit Node Package: <a href="https://www.npmjs.com/package/steem"><em><strong>https://www.npmjs.com/package/steem</strong></em></a><em><strong> </strong></em>You can use this sample to get started on building your more complex &nbsp;bot. I hope you found this tutorial helpful. Follow me for more &nbsp;tutorials on building bots for steemit!&nbsp;</p>
<p><br></p>
<p>please FOLLOW ME and VOTES. (<em><strong>In order to help me because my account in bittrex has been hacked</strong></em>)</p>
</html>
👍 , , , , ,