Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Chetan Giridhar: Rapid development of Unified Real-time communication for Websites

Chetan Giridhar: Rapid development of Unified Real-time communication for Websites

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Chetan Giridhar:
Rapid development of Unified Real-time communication for Websites
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
@ Kiwi PyCon 2013 - Sunday, 08 Sep 2013 - Track 2
http://nz.pycon.org/

**Audience level**

Intermediate

**Description**

Development of real time communication channels like instant chat or media calls has been difficult. Integrating it in a scalable and responsive way for websites has been a bigger concern.

This talk describes how instant chat or media calls can be developed in a rapid way with Python modules and demonstrates the concept with a working prototype.

**Abstract**

Online shopping or retail industry of the world is worth trillions of dollars. Forrester research estimates that US online industry alone will be worth $279 Billion by 2015!

Given the scenario, website customers have an ever-growing need of communicating with customer service representatives in real time with a live chat or media call. Businesses not only view it as an opportunity to act quickly and be flexible in delivering specific product information to customers but also to prevent or recover from service failures & convert leads to sales!

Though critical, development teams have found it difficult to develop, maintain and integrate instant chat or call in their websites. Scalability and responsiveness of these applications have been a measure cause of anxiety. Unavailability or shortage of ready-to-use frameworks has contributed to longer development cycles and made the task seam out-of-reach. As a result, integration of real time communication in websites is often considered 'good-to-have' and doesn't get the due importance.

This talk discusses first hand experiences of development & integration of real-time communication applications in websites. Audiences would get an opportunity to appreciate the concept with the help of a working prototype. The talk also suggests Python modules foe getting the task done in a rapid & customized way.

**YouTube**

http://www.youtube.com/watch?v=fB_XzU8sRbU

New Zealand Python User Group

September 08, 2013
Tweet

More Decks by New Zealand Python User Group

Other Decks in Programming

Transcript

  1. ì       Rapid  Development  &  Integra3on  of  

    Real  Time  Communica3on  in  Websites     PyCon  Kiwi’13     Chetan  Giridhar  
  2. Facts   ì  Website  developers  focus     ì  Core

     func3onality,  Design   ì  User  Interface,  Performance   ì  Sta3s3cs   ì  About  38%  customers  agree  that  they  made  their   deals  from  the  website  due  to  engagement  itself   ì  56%  of  the  people  prefer  live  engagement  over  email   or  social  media  as  preferred  communica3on  method   Could  we  make  websites   beNer?  Can  Python  help?  
  3. Development  Considerations   ì  Asynchronous   ì  Real  3me  exchange

      ì  Full  duplex  communica3on   ì  Store  chat  informa3on   ì  Easy  to  use  APIs  –  think  reuse   ì  Free  and  Open  Source  
  4. Pure  Python   ì  ws4py  –  python  client  library  for

     web  sockets   ì  tornado.websocket.WebSocketHandler   class  Socket(tornado.websocket.WebSocketHandler):      def  on_message(self,  message):          self.write_message(“Msg  is”  +  message)     from  ws4py.client.threadedclient  import  WebSocketCient   class  Client(WebSocketClient)      def  opened(self):  self.send(“Hello”)      def  received_message(self,  message):          print  “From  server:”  +  message     open()   on_close()   closed()  
  5. Framework       Tornado  Web  Server   End  User

      asyncmongo/ redis   Web  Sockets  /  Ajax   Store  Chat   Messages   Analyze  and   generate  paNerns   feedback   HTML/ CSS  
  6. Live  Chat  –  Ajax       func3on  newMessage(form)  {

      $.postJSON("/a/message/new",  message,                                             func3on(response)  {          updater.showMessage(response);          });   }     class  MessageNewHandler:      def  post(self):          message  =  {                "id":  str(uuid.uuid4()),                "from":  self.current_user["first_name"],                  "body":  self.get_argument("body"),          }          message["html"]  =  self.render_string                            ("message.html",  message=message)  
  7. Live  Chat  -­‐  Websockets   var  url  =  "ws://"  +

     loca3on.host  +  "/chatsocket";   updater.socket  =  new  WebSocket(url);   func3on  newMessage(form)  {    updater.socket.send(JSON.stringify(message));   }       class  ChatSocketHandler:      def  on_message(self,  message):          chat  =  {                          "id":  str(uuid.uuid4()),                          "body":  parsed["body"],                          }                  chat["html"]  =  self.render_string                            ("message.html",  message=chat)  
  8. Development   ì  Considera3ons:   ì  Ease  of  use  

    ì  Availability  of  service   ì  Point  to  point   ì  Tools   ì  Web  Server:  Tornado   ì  JavaScript:  webrtc  
  9. What  it  means  to  Business?   ì  BeNer  Marke3ng  demonstra3ons

      ì  Increased  Product  up  sales   ì  Improved  Customer  Sa3sfac3on  Score   ì  Convert  customer  pain  points  to  profits   ì  Compe33ve  Edge   ì  Reduced  Expenses  –  customer  support  3me/telephone     ì  Did  someone  say  more  revenue?  J  
  10. How  can  developers  help?   ì  Commercially  available    

    ì  Used  off  the  shelf?  –  Oqen  not   ì  Data  in  the  desired  format?     ì  To  analyze  and  iden3fy  paNerns   ì  Looks  like  I  can  develop  it  myself??!   ì  When  are  you  building  yours?  J  
  11. References   ì  Market  research:  Forrester  Research  and  Boldchat  

    ì  Demos  hosted  on  hNp://heroku.com     ì  eAssistance  Pro  video  on  youtube.com   ì  webrtc-­‐plugin  hNp://fresh3lledsoil.com/     ì  Free  website  templates  from   hNp://WebsiteTemplatesOnline.com     ì  Tornado  web  server  hNp://tornadoweb.org     ì  MongoDB  www.mongodb.org