标签: google-custom-search

Google CustomSearchControl显示不一致的分页链接

使用CustomSearchControl时,结果页面的数量会根据您正在查看的页面而有所不同.例如,访问此站点并搜索:car

在第一个结果页面上,它将显示指向3个页面的链接,但是当您单击2或3时,它将在第2页结束.

为什么会发生这种情况,是否有解决方法?

如果有可能得到实际的结果数,并建立我自己的分页?

javascript google-custom-search

5
推荐指数
1
解决办法
390
查看次数

Google自定义搜索查询参数和类别参数

所以我正在尝试为Google自定义搜索设置查询参数和类别参数.以下是搜索结果页面的示例网址:

http://www.whiterootmedia.com/search_results/index.html?q=my%20search%20phrase
Run Code Online (Sandbox Code Playgroud)

所以它看起来像是默认查询参数,q所以我q在为我的谷歌自定义搜索引擎设置分析部分时放入框中.这个可以吗?我读过它不是可以使用q但是改为使用query?为什么这很重要?

我也应该设置一个看起来是可选的类别参数.

谢谢,Dusty

google-custom-search

5
推荐指数
1
解决办法
8185
查看次数

有没有办法在使用Google Custom Search API时显示"相关搜索"

我正在使用Google自定义搜索API在我的网站上显示谷歌搜索结果,但是,我想显示"相关搜索",就像在普通谷歌搜索底部显示的那样.

这可能吗?如果是这样,你怎么做?

提前致谢

google-custom-search web

5
推荐指数
1
解决办法
852
查看次数

如何在目标c中使用Google自定义搜索进行图像搜索

任何人都可以告诉我如何在我的iPhone应用程序中使用谷歌自定义搜索只搜索图像.我尝试了但它要求'cse'或'cx'参数.请帮忙.

iphone objective-c ios google-custom-search google-image-search

5
推荐指数
1
解决办法
7148
查看次数

如何开始使用Google Custom Search API?

我正在尝试编写一个使用Google自定义搜索API来检索搜索结果的Java程序.但是,作为API的首次使用者,网站上的文档非常混乱 - 通过连接到谷歌API链接来检索结果,如:

Google Custom Search API

(然后一旦连接,你如何显示结果?使用BufferedReader给我一个403错误)

...或者您是否需要下载库并使用他们的GoogleCustomSearch类:

java google custom search api

?我有googleux-customsearch jar(来自http://blog.lux-medien.com/2011/08/google-custom-search-java-implementation/)并将其集成到Eclipse中,但我不太确定是什么导入我应该使用这些语句来使用这些类(同样是第一次使用者).

我也不太确定Java客户端,REST API和JSON API之间的区别(它们都是一样的吗?),如Google Custom Search API网站上详述的那样......任何人都可以澄清一下吗?谢谢!

google-api-java-client google-custom-search

5
推荐指数
1
解决办法
2万
查看次数

如何在同一页面上显示多个Google自定义搜索字段

我正在尝试使用Google自定义搜索(GCS)在同一页面上设置多个搜索字段,如下所示:

<script>
  (function() {
    var cx = 'user_id:field_id1';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>

<gcse:search></gcse:search>

<script>
  (function() {
    var cx = 'user_id:field_id2';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>

<gcse:search></gcse:search>
Run Code Online (Sandbox Code Playgroud)

不幸的是,它不起作用. …

javascript google-custom-search

5
推荐指数
1
解决办法
3914
查看次数

如何强制谷歌的自定义搜索响应?

我们在其中一个网站上使用Google的自定义搜索引擎,iframe中的一个元素是.gs-webResult {width:42em;}

这基本上是每个结果行的容器div.我不能直接从我的网站更改CSS,因为它在iframe中.

这是我能找到的唯一类似问题:https://drupal.org/node/1420294

答案是:

"您必须在Google AdSense网站的搜索广告中对其进行配置.最后一项设置之一是搜索结果框架的宽度.

无法更改该帧的内容."

最后一行"改变那个框架的内容是不可能的"似乎不太可能.

所以我的问题是,如何将其更改为.gs-webResult {width:100%;}或者是否有一个选项允许我使搜索引擎响应?

谢谢

css search-engine google-search google-custom-search

5
推荐指数
1
解决办法
4941
查看次数

在Google Custom Search API上使用inurl获取网址日期

如何使用GCS(Google Custom Search API)将网址添加到Google索引中?我知道我可以让它抛出"inurl"参数,但仅限常规Google搜索,如下例所示:

https://www.google.com.br/search?q=inurl%3Amoz.com%2Fblog%2F25-killer-combos-for-googles-site-operator

在此输入图像描述

如果有人在java中有一些代码,我会很高兴的.:)

metadata google-api google-custom-search

5
推荐指数
1
解决办法
806
查看次数

如何显示谷歌自定义搜索结果的下一页?

我知道SOF有很多类似的问题,但我没有找到对我有用的东西.根据Google Custom Search文档,&start参数:

The start parameter uses a zero-based index, meaning the first result is 0, the second result is 1 and so forth.

The start parameter works in conjunction with the num parameter to determine which search results to return. 
Run Code Online (Sandbox Code Playgroud)

我尝试从零发送,但应用程序崩溃.在这次尝试中我尝试发送:

为1页: &num=10&start=1

2页: &num=10&start=11

但它仍然要求1页.&start参数始终被忽略

我正在写一个Android应用程序,它进行图像搜索,在向下滚动它应该在下一页(下10个图像),在android 它总是返回1页有10个图像,我在浏览器中测试请求,withount &num参数,它的工作原理.在Android上,似乎在第一页加载后,参数&start&num被忽略.

我使用robospice与改造相结合,我无法弄清楚如何获取请求字符串,也许我做错了什么

这是我的界面:

 public static final String BASE_URL = "https://www.googleapis.com/customsearch";
public static final String API_KEY = "AIzaSyCCuxxVLzm2sZP-adhRNYKeSck1mMMgsAM";
public static …
Run Code Online (Sandbox Code Playgroud)

java rest android google-custom-search

5
推荐指数
1
解决办法
2174
查看次数

Google自定义搜索Api的身份验证

简短的问题:

2015年4月20日之后,是否有人使用Google Custom Search Api进行身份验证?

更长的版本:

我正在尝试使用Google Custom Search Api来请求按需索引.在我开始之前,我遇到了身份验证问题.根据文档,您应该使用ClientLogin Api进行身份验证.这个Api于2015年4月20日关闭,当你尝试从中获取令牌时它现在返回404.

ClientLogin 文档上的弃用通知声明使用Oauth.

因此,我试图验证几乎一样侯赛因在这里 我收到了来自谷歌的承载令牌,但是当我尝试做一个请求,我收到了401以下消息

<Error>You are not authorized to access this resource.  If you feel this is an error, try re-logging into your Google Account.</Error>
Run Code Online (Sandbox Code Playgroud)

这并不奇怪,因为没有最新文档,我盲目地试图寻找正确的解决方案.

我目前在C#中的代码:

private static async Task Run()
{
    var credential = new ServiceAccountCredential( new ServiceAccountCredential.Initializer("blablabla@developer.gserviceaccount.com")
    {
        Scopes = new[] { "https://www.googleapis.com/auth/cse" }
    }.FromPrivateKey("-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----\n"));
    await credential.RequestAccessTokenAsync(CancellationToken.None);
    var token = credential.Token;
    var client = new HttpClient();
    client.DefaultRequestHeaders.Authorization = …
Run Code Online (Sandbox Code Playgroud)

google-api google-search-api google-custom-search google-oauth2

5
推荐指数
0
解决办法
463
查看次数