Created
February 13, 2009 07:01
-
-
Save wuputah/63762 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module GoogleSearchHelper | |
def search_box_js | |
<<-GOOGLE_JS | |
<!-- Google CSE Search Box Begins --> | |
<form action="/search" id="cse-search-box"> | |
<input type="hidden" name="cx" value="YOUR CX VALUE" /> | |
<input type="hidden" name="cof" value="YOUR COF VALUE" /> | |
<input type="text" name="q" size="25" /> | |
<input type="submit" name="sa" value="Search" /> | |
</form> | |
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script> | |
<!-- Google CSE Search Box Ends --> | |
GOOGLE_JS | |
end | |
def search_results_js | |
<<-GOOGLE_JS | |
<!-- Google Search Result Snippet Begins --> | |
<div id="cse-search-results"></div> | |
<script type="text/javascript"> | |
var googleSearchIframeName = "cse-search-results"; | |
var googleSearchFormName = "cse-search-box"; | |
var googleSearchFrameWidth = 600; | |
var googleSearchDomain = "www.google.com"; | |
var googleSearchPath = "/cse"; | |
</script> | |
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script> | |
<!-- Google Search Result Snippet Ends --> | |
GOOGLE_JS | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment