How should I dynamically generate components based on a Google search result?

回眸只為那壹抹淺笑 提交于 2019-12-13 04:18:20

问题


My client is asking for an application that is dynamically generated based on a Google search result.

How I see the scenario playing out:

Google search for a specific lake and a relevant term related to the applications purpose (e.g. 'Test river tubing') -> application submits request to backend using the search term -> return a list of possible locations based on the search term -> user clicks search result -> is brought to a different component that makes additional requests based on the search result.

Seeing as there are too many locations in US to make a dedicated component for, my question is - is there a more efficient way of doing this? The issue is that there is no static component relying on 'Test river' data and it doesn't exist without the search. It would be much better to link from google a dynamically generated component rather than a search page.

Thanks for taking the time to read

EDIT: Sorry this question is a bit muddled. I rewrote it here: How do I configure SEO for a dynamic container component?


回答1:


The purpose of the app is not very clear. From what I understand, I think you would want to use Google Custom Search to create a Custom search engine.

Alternatively, you could try to scrape data (which could get blocked). Anyhow check out

  1. https://developers.google.com/apps-script/reference/url-fetch/
  2. How do I get Google search results from urlfetch in google apps script


来源:https://stackoverflow.com/questions/56843563/how-should-i-dynamically-generate-components-based-on-a-google-search-result

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!