Telegram is a messaging app with a focus on speed and security, it’s super-fast, simple and free. You can use Telegram on all your devices at the same time — your messages sync seamlessly across any number of your phones, tablets or computers.

With Telegram, you can send messages, photos, videos and files of any type (doc, zip, mp3, etc), as well as create groups for up to 200,000 people or channels for broadcasting to unlimited audiences. You can write to your phone contacts and find people by their usernames. As a result, Telegram is like SMS and email combined — and can take care of all your personal or business messaging needs.

What is Telegram Bot?

Bots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages, commands and inline requests.

What is MyWeatherTodayBot?

MyWeatherTodayBot is a Telegram Bot that’s able to send your location and get real time weather forecast.

How MyWeatherTodayBot made?

MyWeatherTodayBot is made by PHP and a web service to get weather forecast. First it receives user input as location (latitude and longitude), and the bot will send a REST POST to an external web service to get weather forecast.

To make your own MyWeatherTodayBot, you need Telegram Apps, and Invited @BotFather (a Telegram own bot that you can create your bot) to your accounts, that you can get started to create bot.

Step by Step to create MyWeatherTodayBot

Chat with @BotFather

Click and send /newbot

Name your bot

Copy the API token and it looks like this: 898795721:AAGkiU2Taw83m6CDpVSpH4PaVbEaFkIByHo

Write a PHP file and hosts on a web server, assume the location of the file is at https://<your web server>/bot/telegrambot.php

Pokemon go released a new version today with new updated feature. One of the features attracted me is that they will remind players when travelling exceed certain speeds. This could be a safety features after many car accidents surfaced on news because of playing Pokemon Go.

I had an apps to use phantomjs to generate a report by using Google Charts.

The apps will spawn a child process to execute phantomjs command, to load a web page that contains the charts, and then take a screenshots saving into JPG, which later convert into PDF for archive.

In the code, it needs to load the following JS URL from Google: https://www.google.com/jsapi, which is HTTPS based.

Suddenly it is stopped working since last month.

By checking the log and found that PhantomJS encountered JavaScript error: “ReferenceError, can’t find Google”. Hey, I tried to open the web page in my local Chrome browser, and it still working. I tried to CuRL from my server, still can download the page. So I suspected might be SSL issues on PhantomJS.

Tried googling and found a solution. As Google had already deprecated the old version of SSL (SSLv3) and use TLSv1.

In the command line, we need to add one more option: –ssl-protocol=tlsv1, to bypass the HTTPS error, and it turns out it is working now.