meBot

Made by Sanjay kumar R

Found in SMS Bot · UNLISTED (SHOWN IN POOLS)

A bot to interact with my recruiters to provide basic informations about me.

0

Intention

This is a sample project to create a simple bot to interact with recruiters to provide basic information about me

0

Context

This was for a mini project and I wanted to show my recruiters I am cable of creating bot/conversational UI. 

0

Process

Followed instructions provided by Daragh closely and implemented the bot using Ruby gem Sinatra, Heroku and Twilio

0

Product

Created an sms bot that recides in Twilio and can be contacted by messaging this number 412-365-4449. 

0

Reflection

I learnt the workflow to create and deploy a simple sms bot using apps and services like Sinatra, Heroku, GitHub and Twilio. 

0
app.rb
require 'sinatra'
require "sinatra/reloader" if development?

require 'twilio-ruby'

enable :sessions
@client = Twilio::REST::Client.new ENV["TWILIO_ACCOUNT_SID"], ENV["TWILIO_AUTH_TOKEN"]

get '/' do
	404
end

get "/sms/incoming" do
  session["last_intent"] ||= nil

  session["counter"] ||= 1
  count = session["counter"]

  sender = params[:From] || ""
  body = params[:Body] || ""
  body = body.downcase.strip
  media = nil

  if body == "who"
    message = "I'm Sanjay's MeBot"
  elsif body == "what"
      message = "I'm a bot that'll let you ask things about Sanjay without bothering him."
  elsif body == "why"
    message = "He made me for this interview. To showcase his skills in creating coversational UI/Bots"
  elsif body = "where"
    message = "I'm on a server in the cloud.. But Sanjay's in Pittsburgh"
  elsif body = "when"
    message = "I was made on Sept 17th, 2017. But Sanjay is much older than that"
  else
    message = "I didn't understand that. You can say who, what, where, when and why?"

  end

  twiml = Twilio::TwiML::MessagingResponse.new do |r|
    r.message do |m|
      m.body( message )
      unless media.nil?
        m.media( media )
      end
    end
  end


  content_type 'text/xml'
  twiml.to_s

end
Sanjay Ranganayakulu (2017) Click to Expand
x
Share this Project

This project is only listed in this pool. Be considerate and think twice before sharing.


Found In
Courses

49714 Programming for Online Prototypes

· 15 members

A hands on introduction to building online products and services through code


About

A bot to interact with my recruiters to provide basic informations about me.

Created

September 21st, 2017