Monday, April 7, 2014

How to Make an SMS Bot


1. Create a free account on IMified, an online software site that helps you create SMS bots which are automatically connected to multiple SMS networks, such as Jabber, Twitter and AIM.
2. Enter a URL where your bot's scripts will be located. This is a web address that you host on a third-party hosting service.
3. Open a basic text editor.
4. Type in a simple script to give your bot enough intelligence to respond to simple messages from SMS users. IMified offers many post variables that you can use for your scripts. For example, if you are scripting in PHP and want your bot to ask 'Hi, who is this?' type:
switch ($_REQUEST['step']) {
echo 'Hi, who is this?';
break;
}
?>The first line begins the PHP script. The second line opens a statement that is executed only when the value matches the switch expression, in this case 'step.' Step is a variable that shows what step the SMS user is on; in other words, whether the user is messaging the bot for the first, second, third, and so on, time in the conversation. The third, fourth and fifth lines of code end the statement. Save your file with whatever name you wish.
5. Open your File Transfer Protocol (FTP) program, such as FileZilla or Transmit. These programs let you upload files to your hosted server. Acquire the name of your server and the password to it from your hosting service. Log in through your FTP. Upload the file you just saved to the URL you set in IMified.
6. Log in to an SMS program such as AIM. Search for your bot's user name, which you gave it when you set up your account on IMified. Type a message to your bot. Your bot responds with the message you gave it in the Switch statement.

No comments:

Post a Comment