如何调整这个 Google 新闻脚本 - 我假设使用变量 - 将当前年份和当前月份放在布尔搜索中 - 具体来说,以“tabbed.execute(...?”
我的最终目标是让这个脚本在当前年份和月份的上下文中返回搜索词。感谢帮助新手!
google.load('search', '1');
function OnLoad() {
// create a tabbed mode search control
var tabbed = new google.search.SearchControl();
// create our searchers. There will now be 4 tabs.
tabbed.addSearcher(new google.search.VideoSearch());
tabbed.addSearcher(new google.search.NewsSearch());
tabbed.addSearcher(new google.search.BlogSearch());
tabbed.addSearcher(new google.search.ImageSearch());
// draw in tabbed layout mode
var drawOptions = new google.search.DrawOptions();
drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
// Draw the tabbed view in the content div
tabbed.draw(document.getElementById("stephennews"), drawOptions);
// Search!
tabbed.execute("'SEARCHTERM1' AND 'SEARCHTERM2' AND '2013' AND 'MARCH'");
}
google.setOnLoadCallback(OnLoad);