<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Awesamm Coder on Medium]]></title>
        <description><![CDATA[Stories by Awesamm Coder on Medium]]></description>
        <link>https://medium.com/@awesammcoder?source=rss-b9d0042188d1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JpKrV-Ecx7saLVeFseRIww.jpeg</url>
            <title>Stories by Awesamm Coder on Medium</title>
            <link>https://medium.com/@awesammcoder?source=rss-b9d0042188d1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:40:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@awesammcoder/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Javascript Tutorial — Simple ChatAI using RiveScript.js]]></title>
            <link>https://medium.com/@awesammcoder/javascript-tutorial-simple-chatai-using-rivescript-js-4f0291e298f1?source=rss-b9d0042188d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f0291e298f1</guid>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[rivescript]]></category>
            <dc:creator><![CDATA[Awesamm Coder]]></dc:creator>
            <pubDate>Mon, 13 Aug 2018 03:11:13 GMT</pubDate>
            <atom:updated>2018-08-13T04:24:45.692Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*nbFqiZZatvuD_ciZ3a_6wQ.png" /></figure><p>Chatbot nowadays plays a bigger role in our day to day living especially to those who were exposed on using internet, visiting web pages and browsing social media sites. Chatbot were mainly used for pre-defined customer support inquiries.</p><p>Today, we will create a simple chatbot web application using HTML, CSS, Javascript, and RiveScript.js. Wait! What is <a href="https://github.com/aichaos/rivescript-js"><strong>RiveScript.js</strong></a><strong>? </strong>It is a RiveScript interpreter library for javascript. <a href="https://www.rivescript.com/"><strong>RiveScript</strong></a> is a scripting language for chatterbots, making it easy to write <strong>trigger/response</strong> pairs for building up a bot’s intelligence. You can read the complete documentation <a href="https://www.rivescript.com/docs/tutorial">here</a>.</p><p>Let’s build first our <strong><em>index.html </em></strong>file, this will be the user-interface for our chat application.</p><p><strong><em>index.html</em></strong></p><pre><strong>&lt;html&gt;</strong><br>  <strong>&lt;head&gt;</strong><br>    <strong>&lt;title&gt;</strong>Simple ChatAI using RiveScript.js<strong>&lt;/title&gt;<br>    &lt;link </strong>rel=&quot;stylesheet&quot; href=&quot;./style.css&quot;<strong>&gt;<br></strong>  <strong>&lt;/head&gt;</strong><br>  <strong>&lt;body&gt;</strong></pre><pre>    <strong>&lt;div</strong> class=”chat”<strong>&gt;</strong></pre><pre>      <strong>&lt;div</strong> class=”messages”<strong>&gt;&lt;/div&gt;</strong><br>      <strong>&lt;div</strong> id=”edge”<strong>&gt;&lt;/div&gt;</strong></pre><pre>      <strong>&lt;form</strong> class=”actions”<strong>&gt;</strong><br>        <strong>&lt;input</strong> type=”text” placeholder=”press ‘Enter’ to send…”<strong>&gt;</strong><br>      <strong>&lt;/form&gt; </strong></pre><pre>    <strong>&lt;/div&gt;</strong><br> <br>    <strong>&lt;script</strong> src=”<a href="https://unpkg.com/rivescript@latest/dist/rivescript.min.js">https://unpkg.com/rivescript@latest/dist/rivescript.min.js</a>&quot;<strong>&gt;&lt;/script&gt;<br>    &lt;script </strong>src=&quot;./script.js&quot;<strong>&gt;&lt;/script&gt;</strong></pre><pre>  <strong>&lt;/body&gt;</strong><br><strong>&lt;/html&gt;</strong></pre><p>And here will be our CSS file named <strong><em>style.css</em></strong></p><pre><strong>*</strong> {<br> font-family: Arial;<br> font-size: 12pt;<br>}</pre><pre><strong>.chat</strong> {<br> width: 400px;<br> height: 90%;<br> position: fixed;<br> overflow: scroll;<br>}</pre><pre><strong>.actions</strong> {<br> position: fixed;<br> bottom: 0;<br> display: block;<br> width: 100%;<br>}</pre><pre><strong>.actions input</strong>{<br> height: 30px;<br> display: block;<br> width: 100%;<br> outline: 0;<br> border-top: 0;<br> border-left: 0;<br> border-right: 0;<br>}</pre><pre><strong>.messages div</strong> {<br> max-width: 60%;<br> display: block;<br> margin: 5px;<br> padding: 10px;<br> border-radius: 7px;<br>}</pre><pre><strong>.messages .bot</strong> {<br> text-align: left;<br> margin-right: auto;<br> background: #001f3f;<br> color: white;<br>}</pre><pre><strong>.messages .self</strong> {<br> text-align: right;<br> margin-left: auto;<br> background: #DDD<br>}</pre><p>Now that we have our user-interface, we need to create next our bot’s logic by creating a new instance of RiveScript interpreter using the code below.<br><strong><em>script.js</em></strong></p><pre>let bot = new <strong>RiveScript</strong>();</pre><p>And create a second file named <strong><em>brain.rive, </em></strong>this file will handle the <strong>trigger/response</strong> data which needed for our bot to know what answer for the questions thrown by the user. We will create just a simple brain library for our A.I, able to greet, ask the user name, and, etc..</p><p><strong><em>brain.rive</em></strong></p><pre>! version = 2.0<br><br>+ hello<br>- hello, what is your name?<br><br>+ hi<br>- hi, what is your name?<br><br>+ my name is *<br>- nice to meet you &lt;star&gt;<br>- nice meeting you &lt;star&gt;<br><br>+ thank you<br>- you are welcome<br>- welcome<br>- no problem<br>- no worries<br><br>+ *<br>- Sorry did not get what you said<br>- I am afraid that i can not understand you<br>- I did not get it<br>- Sorry can you please elaborate that for me</pre><p>( <strong>+</strong> ) plus sign is what we called <strong>trigger<br></strong>( <strong>—</strong> ) minus sign is the <strong>response</strong><br>having a multiple response data under the trigger will let the bot choose randomly on listed responses on what to answer.<br>( <strong>*</strong> ) asterisk act as the wildcard, any messages didn’t matched on the triggers above will fall on this category.<br><strong>&lt;star&gt;</strong> acts as a variable, anything entered in placed of ‘<strong>*</strong>’ will be the value for the &lt;star&gt;, you can have multiple variables. It’s <strong>your call</strong>, i’m telling you! <br><em>e.g:</em></p><pre><em>+ My name is * and i am * years old<br>—  Your name is &lt;star&gt; and you are &lt;star1&gt; years old, right?</em></pre><p>After building the required intelligence for our bot application, we need to add some javascript code that will link the <strong>brain.rive </strong>library in our RiveScript instance, handling events for submitting messages, fetching bot replies, and emulating messages in our user-interface DOM.</p><p>To link <em>brain.rive</em> library in our RiveScript instance do the following. You could have <strong><em>.rive</em></strong> files as many as you want.</p><p><strong><em>script.js </em></strong><em>(continuation)</em></p><pre>const brains = [<br>   &#39;./brain.rive&#39;<br>// &#39;./another-category-sample.rive<br>];</pre><pre>bot.loadFile(brains).then(botReady).catch(botNotReady);</pre><p>After loading successfully our brain library, we need to prepare the events use for submitting messages and fetching bot replies.</p><p><strong><em>script.js </em></strong><em>(continuation)</em></p><pre>const message_container = document.querySelector(&#39;.messages&#39;);<br>const form = document.querySelector(&#39;form&#39;);<br>const input_box = document.querySelector(&#39;input&#39;);</pre><pre>form.addEventListener(‘submit’, (e) =&gt; {<br> e.preventDefault();<br> selfReply(input_box.value);<br> input_box.value = ‘’;<br>});</pre><pre>function botReply(message){<br> message_container.innerHTML += `&lt;div class=”bot”&gt;${message}&lt;/div&gt;`;<br> location.href = ‘#edge’;<br>}</pre><pre>function selfReply(message){<br> message_container.innerHTML += `&lt;div class=”self”&gt;${message}&lt;/div&gt;`;<br> location.href = ‘#edge’;<br> <br> bot.reply(“local-user”, message).then(function(reply) {<br> botReply(reply);<br> });<br>}</pre><pre>function botReady(){<br> bot.sortReplies();<br> botReply(‘Hello’);<br>}</pre><pre>function botNotReady(err){<br> console.log(“An error has occurred.”, err);<br>}</pre><p>I’m glad that you made it here alive! After doing the steps above you will have now a simple chat bot, you can set as many pair of <strong>trigger/response</strong> as many as you want for a better conversation performance.</p><p>You can view it live here: <a href="https://codepen.io/awesammcoder/pen/yqwOPe"><strong>Simple ChatAI using RiveScript.js</strong></a><br>You can also read the <a href="https://www.rivescript.com/docs/tutorial"><strong>documentation</strong></a> for complete reference.</p><h3><strong>Thank you!</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f0291e298f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHP — Hello World]]></title>
            <link>https://medium.com/@awesammcoder/php-hello-world-c3e3fa35c3b0?source=rss-b9d0042188d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3e3fa35c3b0</guid>
            <category><![CDATA[hello]]></category>
            <category><![CDATA[world]]></category>
            <category><![CDATA[hello-world]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Awesamm Coder]]></dc:creator>
            <pubDate>Fri, 10 Aug 2018 00:11:07 GMT</pubDate>
            <atom:updated>2018-08-10T00:11:07.628Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*0rviGMDnS8G7reb5GDYA6A.png" /></figure><p>Hi! Welcome to my first post. Actually this is a test post, so please bear with me. Thank you!</p><p>In this post you will learn how to write a simple webpage using PHP.</p><h3>First of all, What is PHP?</h3><p><strong>PHP</strong> stands for <strong>PHP: Hypertext Preprocessor</strong> is a server side scripting language designed for Web development.</p><h3>Let’s start.</h3><p>Create first a new file named <strong><em>index.php. </em></strong>Write on it the following:<br> &lt;?php<br> echo &quot;Hello World&quot;;<br> ?&gt;</p><h3>Done!</h3><p>That’s how you create a simple web page using PHP, <strong>but you need to host it on a hosting site to see your web page</strong> running which i’ll cover on my next post, just to make this test post short. Thank you for your time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3e3fa35c3b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>