1

I'm currently working on a project where my main focus is to create an Action for Google Home which can be invoked and asked to read out some articles (chosen previously from a list, also by voice) from a particular website. I was wondering if it was possible, or if it were already some similar projects.

What I'd like to do is something like the feature in Pocket or instapaper, where you can make the device read the article for you.

I also thought to make something like a database with all the articles I'm interested in, which auto-updates itself whenever a new article is posted, but my main concern now is to be able to separate the articles in various lists, parse the article and in the end implement text to speech into the Action.

Also some implementations with 3rd party services and apps would be useful.

Please ask me if anything isn't exactly clear, english is not my first language.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
Giorgio Maritano
  • 341
  • 1
  • 3
  • 12

1 Answers1

0

Yes, this is possible. Not necessarily easy, but possible.

First - there is nothing in the Actions on Google library or in Google Home that will automatically scrape a website. That will be up to you.

Second - Responses from your Action are limited in how much they can send at a time.

If you're having it do text-to-speech, you're limited to two "text bubbles" of 640 characters each before the user has to reply. You should keep well below that and should probably stick to just one "text bubble".

If you're playing an audio cut, then you're limited to two minutes.

You can work around both of these limitations by using the Media Response. With TTS, you would play a portion of the text, a brief Media response, at the conclusion of which, your server would be triggered to send the next chunk of text. If it is all recorded, you can just send the longer audio as the Media.

Be advised, however, that if you're using the inline editor or using Firebase Cloud Functions (which the inline editor uses), that by default you're not able to access most sites outside Google's network. You need to upgrade to a paid plan to do so. I suggest the Blaze plan which is pay-as-you-go, but includes a free tier which is typically good enough for development work and light production usage.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Okay, I've been able to scrape some data from the website and it works fine as long as i launch the script from the terminal, but when i upload it to the inline editor it doesn't work, the webhok don't even start. I added cheerio's and request's dependencies to the package.json, but i can't figure it out. do you have any idea or suggestion? – Giorgio Maritano May 07 '18 at 09:10
  • Updated with information about Firebase Cloud Functions and the Dialogflow inline editor. – Prisoner May 07 '18 at 13:31
  • Hi there, i saw your answer here in this [post](https://stackoverflow.com/questions/50422410/use-async-functions-in-dialogflow-webhook), but since i was asking for more info i couldn't comment there. I used the same method used by the owner of the post i linked, but i couldn't make it work. Could you please help me? You can find my code here, i don't understand what i've got wrong. https://github.com/Vaelthur/webscraping-with-dialogflow-incomplete – Giorgio Maritano May 21 '18 at 09:03
  • Can you do this as a new StackOverflow question? New problems are always best done as new questions - this makes it easier for others to find the answer if they're searching. – Prisoner May 21 '18 at 10:15
  • sure, just posted it [here](https://stackoverflow.com/questions/50446759/problems-with-request-and-cheerio-in-dialogflow). Thanks for everything! – Giorgio Maritano May 21 '18 at 10:23