Google 趋势为您提供的相关主题查询的代码导出默认为“热门”结果。有没有办法将“Rising”结果加载为默认值?这是我正在查看的代码:
<script type="text/javascript">
trends.embed.renderExploreWidget(
"RELATED_TOPICS",
{
comparisonItem: [{ keyword: "cats", geo: "US", time: "now 7-d" }],
category: 0,
property: ""
},
{
exploreQuery: "date=now%207-d&geo=US&q=cats",
guestPath: "https://trends.google.com:443/trends/embed/"
}
);
</script>
这是沙箱的链接:https://codesandbox.io/s/google-trends-rmt87?file=/index.html:396-803
要在 Google Trends Explore Widget 代码中加载“Rising”结果作为默认值,请修改 exploreQuery 参数以包含值设置为“rising”的比较选项
<script type="text/javascript">
trends.embed.renderExploreWidget(
"RELATED_TOPICS",
{
comparisonItem: [{ keyword: "cats", geo: "US", time: "now 7-d" }],
category: 0,
property: ""
},
{
exploreQuery: "date=now%207-d&geo=US&q=cats&compare=rising",
guestPath: "https://trends.google.com:443/trends/embed/"
}
);
</script>