Archive For The “Web Tutorials” Category

24 Best WordPress Themes for Bed and Breakfasts

24 Best WordPress Themes for Bed and Breakfasts

Are you looking to create a bed and breakfasts website on WordPress? There are plenty of WordPress themes designed to work specifically for bed and breakfasts. In this article, we have hand-picked some of the best WordPress themes for bed and breakfasts that you can… Read More » The post 24 Best WordPress Themes for Bed and Breakfasts appeared first on WPBeginner. ...

Read more »

How to Create a Video Portfolio in WordPress

How to Create a Video Portfolio in WordPress

Do you want to create a video portfolio in WordPress? By default, you can easily embed a videos in WordPress, but you cannot display multiple videos in a portfolio style layout. In this article, we will show you how to easily create a video portfolio… Read More » The post How to Create a Video Portfolio in WordPress appeared first on WPBeginner. ...

Read more »

Tracking Internal Marketing Campaigns With Google Analytics

Tracking Internal Marketing Campaigns With Google Analytics

Editor’s Note: This article is targeted at readers experienced in using Google Analytics. If you’re new to Analytics, the following guide might be challenging.

Many websites use internal advertising in the form of banners or personalized product recommendations to bring additional products and services to the attention of visitors and to increase conversions and leads. read more

Read more »

5 Best WordPress Landing Page Plugins Compared (2017)

5 Best WordPress Landing Page Plugins Compared (2017)

Looking for an easy way build landing pages in WordPress? You need a landing page plugin that allows you to quickly create landing pages by using simple drag and drop tools without writing any code. In this article, we will review top 5 of the… Read More » The post 5 Best WordPress Landing Page Plugins Compared (2017) appeared first on WPBeginner. ...

Read more »

Friendly, Frictionless Work: Best Practices For Enterprise Messaging UX, From Slack

Friendly, Frictionless Work: Best Practices For Enterprise Messaging UX, From Slack

Creating good user experiences for apps inside messaging platforms poses a relatively new design challenge. When moving from desktop web to mobile interfaces, developers have had to rethink interaction design1 to work around a constrained screen size, a new set of input gestures2 and unreliable network connections. Like our tiny touchscreens, messaging platforms also shake up the types of input that apps can accept, change designers’ canvas size, and demand a different set of assumptions about how users communicate. read more

Read more »

How to Turn Your WordPress Site Into a Social Network

How to Turn Your WordPress Site Into a Social Network

Did you know that you can turn your WordPress site into a social network? A WordPress social network allows users to sign up, connect with each other, post messages, and more. In this article, we will show you how to turn your WordPress site into… Read More » The post How to Turn Your WordPress Site Into a Social Network appeared first on WPBeginner. ...

Read more »

How To Work Out What To Charge Clients: The Honest Version

How To Work Out What To Charge Clients: The Honest Version

Have you ever read a post that has left you feeling wholly inadequate because you know you can’t live up to the high standards they layout? Well, that is how I feel when I read posts about how much to charge my clients.

When Smashing Magazine asked me to write an article sharing my thoughts on pricing my services, I agreed without much thought. But now I sit down to write it, and I’m faced with a conundrum. Do I write about how you should price projects or do I tell you the truth about the unorthodox approach I take? read more

Read more »

How to Manually Update WordPress Plugins via FTP

How to Manually Update WordPress Plugins via FTP

Do you want to learn how to manually update WordPress plugins via FTP? Sometimes the 1-click WordPress plugin update fails which can break your website. The only way to fix that is by manually updating the plugin. In this article, we will show you how… Read More » The post How to Manually Update WordPress Plugins via FTP appeared first on WPBeginner. ...

Read more »

Building A Simple AI Chatbot With Web Speech API And Node.js

Building A Simple AI Chatbot With Web Speech API And Node.js

Using voice commands has become pretty ubiquitous nowadays, as more mobile phone users use voice assistants such as Siri and Cortana, and as devices such as Amazon Echo and Google Home1 have been invading our living rooms. These systems are built with speech recognition software that allows their users to issue voice commands2. Now, our web browsers will become familiar with to Web Speech API, which allows users to integrate voice data in web apps.

With the current state of web apps, we can rely on various UI elements to interact with users. With the Web Speech API, we can develop rich web applications with natural user interactions and minimal visual interface, using voice commands. This enables countless use cases for richer web applications. Moreover, the API can make web apps accessible, helping people3 with physical or cognitive disabilities or injuries. The future web will be more conversational and accessible!

Enhancing User Experience Link

Web Speech API enables websites and web apps not only to speak to you, but to listen, too. Take a look at just some great examples of how it can be used to enhance the user experience. Read more →4

In this tutorial, we will use the API to create an artificial intelligence (AI) voice chat interface in the browser. The app will listen to the user’s voice and reply with a synthetic voice. Because the Web Speech API is still experimental, the app works only in supported browsers5. The features used for this article, both speech recognition and speech synthesis, are currently only in the Chromium-based browsers, including Chrome 25+ and Opera 27+, while Firefox, Edge and Safari support only speech synthesis at the moment.

Browser compatibility6
(View large version7)

This video shows the demo in Chrome, and this is what we are going to build in this tutorial!

[embedded content]
A simple AI chat bot demo with Web Speech API

To build the web app, we’re going to take three major steps:

  1. Use the Web Speech API’s SpeechRecognition interface to listen to the user’s voice.
  2. Send the user’s message to a commercial natural-language-processing API as a text string.
  3. Once API.AI returns the response text back, use the SpeechSynthesis interface to give it a synthetic voice.
The app flow8

The entire source code9 used for this tutorial is on GitHub.

Prerequisites Link

This tutorial relies on Node.js. You’ll need to be comfortable with JavaScript and have a basic understanding of Node.js.

Make sure Node.js10 is installed on your machine, and then we’ll get started!

Setting Up Your Node.js Application Link

First, let’s set up a web app framework with Node.js. Create your app directory, and set up your app’s structure like this:

.
├── index.js
├── public
│ ├── css
│ │ └── style.css
│ └── js
│ └── script.js
└── views
 └── index.html

Then, run this command to initialize your Node.js app:

$ npm init -f

The -f accepts the default setting, or else you can configure the app manually without the flag. Also, this will generate a package.json file that contains the basic info for your app.

Now, install all of the dependencies needed to build this app:

$ npm install express socket.io apiai --save

With the --save flag added, your package.json file will be automatically updated with the dependencies.

We are going to use Express11, a Node.js web application server framework, to run the server locally. To enable real-time bidirectional communication between the server and the browser, we’ll use Socket.IO12. Also, we’ll install the natural language processing service tool, API.AI13 in order to build an AI chatbot that can have an artificial conversation.

Socket.IO is a library that enables us to use WebSocket easily with Node.js. By establishing a socket connection between the client and server, our chat messages will be passed back and forth between the browser and our server, as soon as text data is returned by the Web Speech API (the voice message) or by API.AI API (the “AI” message).

Now, let’s create an index.js file and instantiate Express and listen to the server:

const express = require('express'); const app = express(); app.use(express.static(__dirname + '/views')); // html app.use(express.static(__dirname + '/public')); // js, css, images const server = app.listen(5000); app.get('/', (req, res) => { res.sendFile('index.html'); }); read more

Read more »

24 Best WordPress Themes for Bars and Pubs

24 Best WordPress Themes for Bars and Pubs

Are you looking for the best WordPress themes for bars? A WordPress theme that matches your bar’s real experience and ambiance can bring in more customers and help you grow your business. In this article, we have hand-picked some of the best WordPress themes for… Read More » The post 24 Best WordPress Themes for Bars and Pubs appeared first on WPBeginner. ...

Read more »