top of page
Writer's picturePoopin Mah Business

Week 9

I am now trying to use Pusher, and JQuery to send messages and update the flask webpage dynamically


Pusher is a hosted service that makes it super-easy to add real-time data and functionality to web and mobile applications. Pusher sits as a real-time layer between your servers and your clients. ... Pusher offers libraries to integrate into all the main runtimes and frameworks. PHP, Ruby, Python, Java......


How this works

When a message is sent on the webpage, the message is passed from the webpage to the flask server. The flask server will then call the Pusher API. The Pusher API will receive the message and pass the message to all the clients that are connected, aka us. So, essentially the messages go from our webpage to flask, to pusher and back to our own webpage. Why did I choose to do it this way? Because this allows for easy integration to servers. It is one of the easiest ways to implement message sending functions and also it allows for multiple clients at once. So it is more possible to have multiple consoles open at once (Which I want to leave as a possible feature that we can implement if we wish).



I managed to pass data from javascript to the flask server. The flask server was also able to call the Pusher API and the Pusher API was able to pass data back to the client, which is our webpage. Overall, it was a success. However, I am still left with the task of appending messages received from Pusher API to the webpage itself. Right now it is only a Data Alert javascript.



In the HTML Page


In the Python main routes.py file




1 view0 comments

Recent Posts

See All

Week 15, 16, 17, 18

I have made a simple webpage that we will be using for the gamification part of the project. We wanted to make a short quiz that engages...

Week 11, 12, 13 & 14

I have managed to implement firebase to the console. When sending a command from the console, it will be sent from the webpage to the...

Week 10

Unfortunately, no progress has been made during this week of holiday. I have been rushing to complete both my Deep Learning and Digital...

Comentarios


bottom of page