Build Your first Bot powered by WordPress

Build Your first Bot powered by WordPress

Few weeks ago I did a very basic experiment to create, for one of our test websites, a bot on Telegram and to feed it with data coming from their WordPress website.

Camminando Con is a trekking organization, offering hiking tours in a small valley one hour from Rome and the content structure of their website reflects their simple business model. They use WordLift to structure this content in a way that allows them to exploit it in several ways. 

WordLift helps digital editors organizing and structuring the content of a website. WordLift creates open datasets of all the things that matter and publishes them as open data.

Website Content Structure | WordLiftPresenting their excursions – structured by WordLift as events using the vocabulary – they describe all the sites they visit on their tours – represented as places in – so that anyone, by reading their site, can get a good understanding of the upcoming events and the territory they will explore.

This structured data is then connected through WordLift’s interactive map and discovery widgets that allow their users to explore related content.

Once the content work is done, they promote it via their website and an active Facebook page. I thought I could add a new interaction channel to their communication plan, leveraging the knowledge graph they create event after event. 

Let’s build the Bot

Telegram is a messaging platform similar to WhatsApp, WeChat or Facebook Messenger that lets users communicate in groups or one-to-one. I’ve chosen Telegram because chat-bots can be easily created: you simply chat with another Bot called the ‘BothFather’ (just look for it and add it to your contact list) and your automata will be ready to go in a second. Here are the steps you need to follow:

BotFather supports several commands; to create a new Bot open a chat with him and send the /newbot command.

Bot Father

Bot Father

Take note of the API key (token) and remember that a bot always uses a user name ending in bot (i.e. WordLiftBot).

Telegram Camminando Con | WordLiftNow create a new public (or private) channel and add the bot as administrator of the channel (the bot does’t appear in the list of friend so you will need to remember its name and type it – WordLiftBot in our case).

Your Bot is now the admin of the chat channel. Not bad in just few minutes, right? What’s next?

Next we need to get an update every time a new event is published on the CamminandoCon website. In the CamminandoCon website, as seen earlier, events are constantly updated to promote the upcoming hiking tours and every event focuses on 3 or 4 locations at the time (villages or point of interests that will be seen while walking).

To recall their events we are going to use an HTTP end-point that WordLift adds to every website: http://<yourwebsite>/wl_entity_type/event; through this end-point we can get an ordered list of all the events published on the site; adding /feed/ to this URL (http://<yourwebsite>/wl_entity_type/event/feedthe list is automatically converted by WordPress into an RSS feed that we can use with our Bot. 

IFTTT CommandTo glue our Telegram Bot with the RSS feed coming from WordLift – without writing a single line of code – I used IFTTT. Get a login there (if you don’t have one already) and create a new recipe IF > Feed adding the RSS feed generated by WordLift.

The THEN part is a Maker (a simple app that lets you send web requests to publicly available APIs) and here is how to configure it:
IFTTT Recipe | WordLift

Last, you have to use the API key received by the Bot Father and add it before the /sendMessage as shown above (<your-api-key>/sendMessage). The method is set to POST and the Content Type is application/x-www-form-urlencoded. The Body contains the actual message that the Bot shall send. Here we can see we’re asking to send the update in the @CamminandoCon channel and the text is a combination of elements derived from the RSS feed such as the Title, the URL and the Image.

Here is the result as seen on the Telegram desktop client.

Telegram | WordLift

Happy Bot development!

In the shadow of Anulu

In the shadow of Anulu

It’s been a surreal August 2016; assuming surreality exists. It’s been decades since the disclosure of techniques about imagination: customs and traditions of the mind to shape our personal worlds and build positive events for ourselves. But given the success among people of visual by-products, we can state that there is no difference between reality and surreality. A notorious thinker, associating true/false (maybe Nietzsche) once said: truth doesn’t exist, reality is perception. And the creative ones, of point of views, don’t they appear surreal at the eyes of others when they are shared? Acceptable visions, as most people call them, but it’s not what I see!

A month ago, July 2016, there was a little group of children near the place where I’m writing from, and the grown-ups, parents or not, getting close to each other (I’m not sure why) were asking themselves: what will they write in their back-to-school essay assignment titled “what did you do during the holidays?”. They were feeling that the situation was getting out of hand and becoming irrational already, just a few days into their summer break.

Finally a summer of un-named stars, of clouds passing by that don’t resemble anything, of tired weather forecasts, of stories, encounters and clashes handled with the energy of a sloth. As always, there were daily ritual confrontations though: both verbal and physical.

We are at the beach, it used to be more isolated before. It gathers random people, locals and foreigners. A cabin is the collection point; built to be good, homey. Its shadow offers some relief to its guests. Near and around more modern shelters and a trivial space dedicated to fire, during a month, August, always above 30°, including at night.

Besides the “passers-by”, at the cabin there are a few usuals: sorcio, rana, and paperello. The usuals sweep, embellish, order and scrutinize, far and close; once everything is calm, they entertain themselves and the passers-by.

Paperello, right on August 1st, from a palm trunk brought there by the sea, created ANÙLU, baptizing the first pagan totem in the area. He built a pedestal and a core to erect it, and positioned it looking east, between the cabin and the sea. Immediately the environment turned into a space, the beginning of a human recognizable order, an explosive un-directional zone typical of the first post-caveman’s villages. Flies arrived soon-after, for duty to report. Meanwhile, someone started talking about the “God ANULU”. Exaggerating: there is always a cult and someone who overreacts. But it is a known fact that the shoreline is also a path for pilgrimages: from morning to evening, young and old, back and forth. People started noticing and stopping by. Coming back the following day with their smartphones for the unmissable selfie, laughing unaware.

At the end of August someone dared to say that 3000 selfies had been taken, with the help from MANITA, another pagan totem, newer, embossed on another piece of palm trunk with the help of Rana. Without pedestal this time, it is self-standing. About the relationship between the totems, rumor has MANITA as the daughter of ANULU.

Anulu Beach | WordLiftThe cabin upstream, the sea in front, the father totem in the right half, the daughter totem closer to the sea in the left half, they marked together the free path, street or square toward fresh reliefs. This is where everything happened.

In a context like this, different manifestations of the matter can appearo: hot, competitive, airy, spiritual, almost esoteric; but always real. Many of them look like they just stepped out of the Peanuts, including the dazed observing dog; or read in Alan Ford, a comic about secret agents that became famous with number 26, when the alcoholic menace “Superciuk” showed up; or out of Castaneda’s books, where evening and nocturnal discussions were anticipated by him saying that there are not two separate worlds, two different realities, a normal world and a paranormal world… but only one world, that you can “look at” or “see”; or out of Tex Willer, wise navajos leader, eagle of the night – a legend; or resembling other comic characters, like Poldo Sbaffini (Popeye), trickster, flatterer, eternally hungry and hamburger craver; or Bongo the gorilla (from the Italian comic Nonna Abelarda), which communicated with sentences written on banners instead of the classic cloud.’s blog posted at the end of August the latest cover of Zagor-te-nai, the spirit with the Hatchet. Rana dared to feel and describe himself as Zagor, and dared also to say it out loud. There were a few Indians here and there; maybe that’s what confused him. In a few words, normal people from real life, characters of a bigger story. 

Il bar sotto il mare Stefano Benni | WordLiftIt was like reading a book titled “The cabin on the sea”, something like Il bar sotto il mare, by Stefano Benni, “where everything can happen…where all of us want to be”.

You might not believe me, I know. We spend half of our life laughing at other people’s beliefs and the other half believing in what other people laugh at. I often read the blog, where Maria De Biase tells us of books, authors and characters playing between truth and fiction. In one of her latest post, she introduced Nausea by J.P. Sartre, and the difference between what’s internal and what’s external in a context made of an absurd life. While I was reading the post, father ANULU and daughter MANITA were still there: enclosing, observing and protecting their space and whoever came to do daily ablutions. Passers-by were increasingly intrigued by the religious paganism of the situation.

Today is the last day of August 2016; at the cabin there is only a woman wearing a mask, who dove to look for heart-shaped stones. She gathers and collects them. Will she classify them? Will there be an order understood by both machines and people to collect heart-shaped stones?

A Japanese writer, Marie Kondo, known for her book “The Life-Changing Magic of Tidying Up: The Japanese Art of Decluttering and Organizing,” suggests a method to organize our life organizing our surroundings. Following a similar approach, if you write a blog and you want to share your passions, you should re-organize your blog into an open dataset, adding a classification system to your personal diary, enhancing the value of your thoughts, your attentions and the objects you care about. For example, if you write a deep study in your blog about the world of comic books, those should be classified and organized in open datasets and presented to the web and to readers according to how machines, search engines and our personal memory work, making it easier for our comic books to be found and read.

If your blog is on WordPress, you can download the plug-in WordLift and it will take care of this task for you. WordLift is a web organizer for professional online publishers, that automatically makes your diary (blog), and all the emotions, interests, pictures, memories, hobbies, advices it contains, as well as your life, accessible to machines, search engines and people.

WordLift is the best solution to rearrange our digital expressions, to make them readable and sharable, associating them to similar content. To do so it follows the same schemes our mind uses to build our memories and classify our knowledge and the same classification models used by common knowledge platforms such as Google and Wikipedia. It could classify and further enhance our comic’s characters and superheros, attaching to them a layer of metadata answering the following questions: where? …  when? …  who? … what is it? … what is it connected to? … what deepens it? … building the quintessential network of comics any comic book publisher dreams about.

P.S.: the nickname Sorcio, Rana e Paperello (and several of the non-quoted passers-by) are taken from the series

? Hello WordLift ?

? Hello WordLift ?

What a remarkable few days we had. Last Tuesday we arrived in Leipzig for the SEMANTiCS conference sponsored by our EU research project MICO and we completed the development of this website that lets users instantly grab an account to get started with the latest release of our plugin. ?

The message at the conference was received loud and clear – the linked data community knows WordLift already after all. Now we will start full steam to bring the plugin outside of the research world and in the hands of journalists, content producers, bloggers, site builders and enterprises.

For much of these four past years we’ve been working to develop a product that would help content creators produce richer content and organize it around their audience. Whilst continuing working on other projects to finance WordLift we have finally created a dedicated team around the plugin and we’re getting on board our first clients.

WordLift organizes knowledge, reducing the complexity of content management and digital marketing operations to let authors focus on stories and communities. The plugin brings content discovery and recommendations, adds semantic markup but most importantly, WordLift publishes all metadata as linked open data as a new way to syndicate content and implement new business models.

Join us on this journey

In spirit of listening closely to our early users, we’re continuing the development of the plugin on GitHub where anyone can vote, comment or contribute on the features they want to see in WordLift.

Please feel free to email us on [email protected] if you have any feature requests, comments, or just want to say “ciao”.

We’re also available on Twitter @wordliftit and Facebook.

Stand out on search in 2019. Get 50% off WordLift until January 7th Buy Now!