Google Search Results
ExpressionEngine 1.x
Back to this add-on's main page
View Other Add-ons From Derek Hogue
Support for extra parameters
General
Chad Crowell
|
Posted: 05 October 2010 06:23 PM |
|
|
|
I have a G site search with these parameters:
<input name=“cx” type=“hidden” value=“017180522165740084141:v1wbqwoih_k” />
<input name=“as_q” type=“hidden” value=“more:tuck” />
<input name=“cof” type=“hidden” value=“FORID:11” />
<input name=“ie” type=“hidden” value=“UTF-8” />
<input id=“btnask” value=“Go” name=“submit” type=“submit” />
I just setup your plugin on the site and am passing the cse to it (cx value above) and also need to pass the as_q value to it to limit the results to a specific part of the collection. Can this be done?
|
|
|
Derek Hogue
|
Posted: 05 October 2010 06:34 PM |
# 1
|
|
Developer
|
Hey Chad—the Google AJAX Search API doesn’t accept the advanced query parameters as far as I can tell, so using this method you’d have to add any results tweaks via the CSE control panel directly.
|
|
|
Matt Bower
|
Posted: 07 October 2010 05:00 PM |
# 2
|
|
|
Hi Derek,
I’m Chad’s code monkey. I hacked your plugin to just add a few additional tag parameters and it worked great. I added the following just below the check for the “cse” param:
if($TMPL->fetch_param(‘as_q’) != FALSE) $args[‘as_q’] = $TMPL->fetch_param(‘as_q’);
if($TMPL->fetch_param(‘cof’) != FALSE) $args[‘cof’] = $TMPL->fetch_param(‘cof’);
if($TMPL->fetch_param(‘ie’) != FALSE) $args[‘ie’] = $TMPL->fetch_param(‘ie’);
I tried to find docs on some of these params. I couldn’t find them in Google’s docs (go figure) but came up with this page that mentions some other GSS params to consider adding support for. It looks like they can all just get rolled into the AJAX URL call.
http://itservices.stanford.edu/service/websearch/google/asq_documentation
|
|
|
Derek Hogue
|
Posted: 07 October 2010 08:03 PM |
# 3
|
|
Developer
|
Hey Matt—interesting to know, must be an undocumented part of the API. WIll add those parameter into an update. Thanks!
|
|
|
Matt Bower
|
Posted: 11 October 2010 04:51 PM |
# 4
|
|
|
Hey Derek. Got passed this URL for GSS param docs. Not sure if you’ve seen this before or not. Seems pretty comprehensive.
http://www.google.com/cse/docs/resultsxml.html
|
|
|
Derek Hogue
|
Posted: 12 October 2010 01:23 PM |
# 5
|
|
Developer
|
Thanks Matt ... I’m not entirely sure that the AJAX Search API follows the same specs as the GSS, but when I get time I’ll experiment with that theory.
|
|
|