This module is intended for students to quickly learn how to crawl a table on some of the more popular web sites. Experience First Go to the following web site to view the “Past 24 hour” air pollution data of Hong Kong. https://www.aqhi.gov.hk/en/aqhi/past-24-hours-pollutant-concentration.html This is a web site maintained by the Environmental Protection Department of Hong Kong on pollution of 18 districts. The Data Kwun Tong Air Pollutant Concentration on 9th December 2020 Web Link: https://www.aqhi.gov.hk/en/aqhi/past-24-hours-pollutant-concentration.html Feel free to click on any district names on the left column to get the data at that district. Of course, the web address once… Read More
We want to create a simple illustration to get API data. First we will do it with just Python. Then, just for fun, we use Xcode to create an APP doing the same. We are skipping a lot of error correction so we can illustrate how to get data from a common API in as few lines of codes as possible. Data Source: We use OpenWeather to source our weather data. OpenWeather is simple to use and you can get free API. https://openweathermap.org To get the API key, you will need to register. Simple follow the steps on https://openweathermap.org/appid Once you have followed… Read More
My new MacBook for months surprised me with really poor battery performance. Really my oversight. Check the Activity monitor and you may find that the Chrome is running on GPU unless you specifically disable it in the Chrome preference setting.
Our objective here is to connect our Messenger Chatbot with Dialogflow so we can leverage on the multiple language capabilities (to be done later) and the natural language processing (NLP). We have settled down with a flow for this exercise. a. Use Chatfuel to connect to Facebook Messenger b. Use the Janis template build into Chatfuel to start the connection to Dialogflow. A video is produced and shown below. Take away: (1) Janis, through Slack, provides a rather intuitive way to do the connection. When you are stuck in Janis, you can always type “add bot” to get you back… Read More
Our colleagues have prepared some nice Python code with Google Translate and we look for a quick way to deploy to Messenger. We have decided that the quickest way would be to use the following tools: Chatfuel (for connecting to Messenger), NodeJS for server side connection, and Heroku to upload both the Python code and the NodeJS code. In this exercise, here is what we did: Implement the Google Translate portion in Python. Use Flask to help generate the web framework. In the main python program, it merely does the @app.route function which calls on another function to do the… Read More