The second function of our microservice is to conduct a search of a specific term on Wikipedia. In order to do this we are using the Wikipedia open source library found on GitHub. At the time of the writing of this book a NuGet package was not available so the source was downloaded and compiled. Both the source and the compiled binary are available via the website information listed in the front of the book. The function will look like this:
bool ProcessWikipediaSearchMessage(WikipediaSearchMessage msg)
{
SearchWikipedia(msg.searchTerm, msg.maxReturns, msg.maxReturns, Language.English);
return true;
}
Why search Wikipedia? Why not, Alexa does, right? So you now will have the capability to perform searches for things and have their results spoken back to you. You might be wanting to learn the definition of a word, understand what a new term means...