Use Machine Learning in your code, without being a ML expert, Codemotion Rome

Using Google Cloud AutoML to automatically train models on your custom data? Yes, and we can go deeper, exploring how to add image classification, speech recognition, video labelling and other machine-learning powered tasks to your code, without a PhD on the matter, thanks to Google solutions.

(Codemotion Rome, 14 April 2018)

Exploring Google Assistant, Codemotion Rome

How does Google Assistant work? How to design and add new capabilities? In this talk, we’ll see how to interact with the Assistant in Google Home and other devices, how to add custom Actions and how to understand what users are saying and reply to them using API.ai service.

(Codemotion Rome, 24 March 2017)

Conversational power for Android apps, Codemotion Milan

Conversational interfaces are the new cool. During the session we’ll see how to add conversational power to any Android app: from listening to the user, understand what she said and provide voice replies. Using internal APIs, external service and a little bit of code.

(Codemotion Milan, 25 November 2016)

Conversational power for Android apps, DevFest Nantes

Conversational interfaces are the new cool. During the session we’ll see how to add conversational power to any Android app: from listening to the user, understand what she said and provide voice replies. Using internal APIs, external service and a little bit of code.

(DevFest Nantes, 9 November 2016)

More Telegram bot features using IFTTT

Telegram bot with IFTTT recipesNow that I created a Telegram bot fed by IFTTT, I can add new features using the available channels. A message with the Milan weather condition every morning, for example, or a cool 500px picture during the day to take a break and enjoy the beauty? Possibilities are limited only by IFTTT skills.

The logic is easy: every recipe has a different trigger (the “this” past), and the action is always the same: use the Maker channel to send a POST HTTP call to the Telegram bot, formatting the message with the specific information I want to display. To create the Telegram bot, please look to my previous post.

Weather

Telegram bot weather

The trigger to activate in the Weather channel is “Today’s weather report”, setting the time of the day the report has to be sent. I set 7.00 am because I prepare last minute, but it’s also possible to select “Tomorrow’s weather report” and receive the message the evening for the ones that want to plan what to dress the next day in advance. There are plenty of other information available in the triggers, like sunrise and sunset time, change of conditions / temperature and much more. The city is selected when the channel in connected with the IFTTT account.

The action is the “Make a web request” is the Maker channel, using the following parameters (XXtokenXX and the chat_id have to be changed with the appropriate values):

  • URL: https://api.telegram.org/botXXtokenXX/sendMessage
  • Method: POST
  • Content type: application/json
  • Body: {“chat_id”:”-235327410″, “text”:”Good morning. In Milan {{TodaysCondition}}, max {{HighTempCelsius}} min {{LowTempCelsius}}”}

Cool 500px pictures

Telegram bot with picture

The trigger to activate in the 500px channel is “New Editors’ Choice photo”, selecting one of the available categories, or any.

The action is the “Make a web request” is the Maker channel, using the following parameters:

  • URL: https://api.telegram.org/botXXtokenXX/sendMessage
  • Method: POST
  • Content type: application/json
  • Body: {“chat_id”:”-235327410″, “text”:”Breath and enjoy the beauty: [<<<{{Title}}>>>]({{SourceUrl}})”, “parse_mode”:”markdown”, “disable_web_page_preview”: “false”}

In order to have a preview of the image embedded in the bot message, I used parse_mode set to markdown and i set disable_web_page_preview to false, even if it’s the default setting. Of course the text value is written using Markdown syntax. For more information on the available parameters, the official doc is a good reference. Again, XXtokenXX and the chat_id have to be changed with the appropriate values.