SlideShare a Scribd company logo
 
Rapid Development & Integration of 
Real Time Communication in Websites 
PyCon Kiwi’13 
Chetan Giridhar
Facts 
 Website developers focus 
 Core functionality, Design 
 User Interface, Performance 
 Statistics 
 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 communication method 
Could we make websites 
better? Can Python help?
Demo
Development Considerations 
 Asynchronous 
 Real time exchange 
 Full duplex communication 
 Store chat information 
 Easy to use APIs – think reuse 
 Free and Open Source
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()
Framework 
Tornado Web Server 
End User 
asyncmongo/r 
edis 
Web Sockets / Ajax 
Store Chat 
Messages 
Analyze and 
generate patterns 
feedback 
HTML/CS 
S
Live Chat – Ajax 
function newMessage(form) { 
$.postJSON("/a/message/new", message, 
function(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)
Live Chat -Websockets 
var url = "ws://" + location.host + "/chatsocket"; 
updater.socket = new WebSocket(url); 
function 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)
Demo
Development 
 Considerations: 
 Ease of use 
 Availability of service 
 Point to point 
 Tools 
 Web Server: Tornado 
 JavaScript: webrtc
What it means to Business? 
 Better Marketing demonstrations 
 Increased Product up sales 
 Improved Customer Satisfaction Score 
 Convert customer pain points to profits 
 Competitive Edge 
 Reduced Expenses – customer support time/telephone 
 Did someone say more revenue? 
How can developers help? 
 Commercially available 
 Used off the shelf? – Often not 
 Data in the desired format? 
 To analyze and identify patterns 
 Looks like I can develop it myself??! 
 When are you building yours? 
References 
 Market research: Forrester Research and Boldchat 
 Demos hosted on http://heroku.com 
 eAssistance Pro video on youtube.com 
 webrtc-plugin http://freshtilledsoil.com/ 
 Free website templates from 
http://WebsiteTemplatesOnline.com 
 Tornado web server http://tornadoweb.org 
 MongoDB www.mongodb.org
Questions? 
Source Code 
https://github.com/cjgiridhar 
Blog 
http://technobeans.com 
Contact 
cjgiridhar@gmail.com
Live chat demo -Tourism 
Chat 
Window
Demo… 
User login 
with gmail 
(openid) 
Cross 
selling with 
Chat
Video Chat – Interior Design
Rapid development & integration of real time communication in websites
Rapid development & integration of real time communication in websites

More Related Content

PDF
Design patterns in python v0.1
PPTX
Testers in product development code review phase
PPTX
API Workshop: Deep dive into REST APIs
PPTX
Writing code samples for API/SDK documentation
PPTX
API workshop: Introduction to APIs (TC Camp)
PPTX
API Workshop: Deep dive into code samples
PPTX
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
PDF
Developing an Ember Test Strategy - EmberConf 2019
Design patterns in python v0.1
Testers in product development code review phase
API Workshop: Deep dive into REST APIs
Writing code samples for API/SDK documentation
API workshop: Introduction to APIs (TC Camp)
API Workshop: Deep dive into code samples
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Developing an Ember Test Strategy - EmberConf 2019

Viewers also liked (11)

PPTX
PyCon India 2012: Rapid development of website search in python
PDF
Bytecode Optimizations
PDF
Fuse'ing python for rapid development of storage efficient FS
PDF
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
PDF
Diving into byte code optimization in python
PPTX
Pycon11: Python threads: Dive into GIL!
PPTX
Async programming and python
PDF
OOPS Advanced
PPTX
The Awesome Python Class Part-4
PDF
Object Oriented Programming : Part 2
PyCon India 2012: Rapid development of website search in python
Bytecode Optimizations
Fuse'ing python for rapid development of storage efficient FS
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
Diving into byte code optimization in python
Pycon11: Python threads: Dive into GIL!
Async programming and python
OOPS Advanced
The Awesome Python Class Part-4
Object Oriented Programming : Part 2
Ad

Similar to Rapid development & integration of real time communication in websites (20)

PPTX
REAL TIME CHAT APPLICATION USING DJANGO.pptx
PDF
WebCamp Ukraine 2016: Instant messenger with Python. Back-end development
PDF
Websocket 101 in Python
PDF
WebCamp 2016: Python. Вячеслав Каковский: Real-time мессенджер на Python. Осо...
PPT
Real-Time Python Web: Gevent and Socket.io
KEY
Socket.io
PPTX
Messaging for Real-time WebApps
PPT
Get Real: Adventures in realtime web apps
PPTX
WebSockets-Revolutionizing-Real-Time-Communication.pptx
PPTX
CLIENT SERVER COMMUNICATION.pptx
PDF
WebSockets Jump Start
PPT
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
PDF
Real time web_apps_pycon2012-v1
PDF
Let's Get Real (time): Server-Sent Events, WebSockets and WebRTC for the soul
PDF
Websockets talk at Rubyconf Uruguay 2010
PPTX
V2 peter-lubbers-sf-jug-websocket
PPTX
Chat App Presentation.pptx
PPTX
Realtime web2012
PDF
WebSocket Perspectives and Vision for the Future
PDF
How to build a realtime, WebSockets-enabled chat in less than 5 minutes
REAL TIME CHAT APPLICATION USING DJANGO.pptx
WebCamp Ukraine 2016: Instant messenger with Python. Back-end development
Websocket 101 in Python
WebCamp 2016: Python. Вячеслав Каковский: Real-time мессенджер на Python. Осо...
Real-Time Python Web: Gevent and Socket.io
Socket.io
Messaging for Real-time WebApps
Get Real: Adventures in realtime web apps
WebSockets-Revolutionizing-Real-Time-Communication.pptx
CLIENT SERVER COMMUNICATION.pptx
WebSockets Jump Start
Camelone-2012 HTML5 WebSocket ActiveMQ/Camel
Real time web_apps_pycon2012-v1
Let's Get Real (time): Server-Sent Events, WebSockets and WebRTC for the soul
Websockets talk at Rubyconf Uruguay 2010
V2 peter-lubbers-sf-jug-websocket
Chat App Presentation.pptx
Realtime web2012
WebSocket Perspectives and Vision for the Future
How to build a realtime, WebSockets-enabled chat in less than 5 minutes
Ad

Recently uploaded (20)

PDF
The Internet -By the Numbers, Sri Lanka Edition
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPT
tcp ip networks nd ip layering assotred slides
PDF
Testing WebRTC applications at scale.pdf
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PPTX
Introduction to Information and Communication Technology
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
Funds Management Learning Material for Beg
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
artificial intelligence overview of it and more
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
Sims 4 Historia para lo sims 4 para jugar
The Internet -By the Numbers, Sri Lanka Edition
Module 1 - Cyber Law and Ethics 101.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
RPKI Status Update, presented by Makito Lay at IDNOG 10
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
tcp ip networks nd ip layering assotred slides
Testing WebRTC applications at scale.pdf
522797556-Unit-2-Temperature-measurement-1-1.pptx
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
Introduction to Information and Communication Technology
Paper PDF World Game (s) Great Redesign.pdf
QR Codes Qr codecodecodecodecocodedecodecode
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Funds Management Learning Material for Beg
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PptxGenJS_Demo_Chart_20250317130215833.pptx
artificial intelligence overview of it and more
Tenda Login Guide: Access Your Router in 5 Easy Steps
international classification of diseases ICD-10 review PPT.pptx
Sims 4 Historia para lo sims 4 para jugar

Rapid development & integration of real time communication in websites

  • 1.  Rapid Development & Integration of Real Time Communication in Websites PyCon Kiwi’13 Chetan Giridhar
  • 2. Facts  Website developers focus  Core functionality, Design  User Interface, Performance  Statistics  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 communication method Could we make websites better? Can Python help?
  • 4. Development Considerations  Asynchronous  Real time exchange  Full duplex communication  Store chat information  Easy to use APIs – think reuse  Free and Open Source
  • 5. 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()
  • 6. Framework Tornado Web Server End User asyncmongo/r edis Web Sockets / Ajax Store Chat Messages Analyze and generate patterns feedback HTML/CS S
  • 7. Live Chat – Ajax function newMessage(form) { $.postJSON("/a/message/new", message, function(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)
  • 8. Live Chat -Websockets var url = "ws://" + location.host + "/chatsocket"; updater.socket = new WebSocket(url); function 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)
  • 10. Development  Considerations:  Ease of use  Availability of service  Point to point  Tools  Web Server: Tornado  JavaScript: webrtc
  • 11. What it means to Business?  Better Marketing demonstrations  Increased Product up sales  Improved Customer Satisfaction Score  Convert customer pain points to profits  Competitive Edge  Reduced Expenses – customer support time/telephone  Did someone say more revenue? 
  • 12. How can developers help?  Commercially available  Used off the shelf? – Often not  Data in the desired format?  To analyze and identify patterns  Looks like I can develop it myself??!  When are you building yours? 
  • 13. References  Market research: Forrester Research and Boldchat  Demos hosted on http://heroku.com  eAssistance Pro video on youtube.com  webrtc-plugin http://freshtilledsoil.com/  Free website templates from http://WebsiteTemplatesOnline.com  Tornado web server http://tornadoweb.org  MongoDB www.mongodb.org
  • 14. Questions? Source Code https://github.com/cjgiridhar Blog http://technobeans.com Contact cjgiridhar@gmail.com
  • 15. Live chat demo -Tourism Chat Window
  • 16. Demo… User login with gmail (openid) Cross selling with Chat
  • 17. Video Chat – Interior Design