Ask a Question related to Dreamweaver AppDev, Design and Development.
-
FLEQUE #1
Google API
I have the following code for a search engine in our website. The search engine
work just fine but only returns 10 results. I want to modify the code to give
me a navigation just like google after 10 returns (page 1 of 200) and be able
to have the option to search the web or our website using the GOOGLE API.
<%
Google_Web_APIs_license_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
If Request.Form("searchstring") = "" Then
Search_String = ""
Else
Search_String = Request.Form("searchstring")
End If
'
' This SOAP message came from the Google API soap-examples.
' Dump the SOAP message into an XML document and set the key value,
' search string value and start index.
'
Set objInputXMLDoc = Server.CreateObject("Microsoft.XMLDOM")
objInputXMLDoc.load Server.MapPath("google/doGoogleSearch.xml")
objInputXMLDoc.selectSingleNode("//key").Text = Google_Web_APIs_license_key
objInputXMLDoc.selectSingleNode("//q").Text = Search_String
objInputXMLDoc.selectSingleNode("//safeSearch").Text = Search_String
objInputXMLDoc.selectSingleNode("//start").Text = 1
'
' Post the SOAP message.
'
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "post", "http://api.google.com/search/beta2", False
objXMLHTTP.setRequestHeader "Content-Type", "text/xml"
objXMLHTTP.setRequestHeader "SOAPAction", "doGoogleSearch"
objXMLHTTP.send objInputXMLDoc
'showXML(objXMLHTTP.responseText)
'
' Dump the results into an XML document.
'
Set objOutputXMLDoc = Server.CreateObject("Microsoft.XMLDOM")
objOutputXMLDoc.loadXML objXMLHTTP.responseText
'
' Parse the XML document.
'
Set Nodes = objOutputXMLDoc.selectNodes("//item")
For Each Node In Nodes
Response.Write "<a href=""" & Node.selectSingleNode("URL").Text & """>" &
Node.selectSingleNode("title").Text & "</a><br>"
Response.Write Node.selectSingleNode("snippet").Text & "<BR>"
Response.Write "<font color=green>" & Node.selectSingleNode("URL").Text &
"</font>"
Response.Write "<font color=green>"" - " &
Node.selectSingleNode("cachedSize").Text & "</font>"
Response.Write "<BR>"
Response.Write "<BR>"
Next
%>
<%
Function showXML(XMLSource)
Response.Clear
Response.Write XMLSource
Response.End
End Function
%>
FLEQUE Guest
-
Google Adsense
How do I add the AdSense code using Contribute v2.0? -
Google groups
Hi Why am I not able to finde this newsgroup in Google Groups Henning -
Google FYI
http://www.geek.com/news/geeknews/2006Jan/gee20060202034550.htm Have Fun! -
PHP<->Google?
I'm so curious to know whether Google uses PHP or not. Some pages on the net says that Google uses PHP. Is it true? If so, what database they use?... -
Google is not my friend
Wadda we have now, probably a few million OSX users world-wide. And yet, just try to find a half-ways descent router to use with OSX. I tried... -
Julian Roberts #2
Re: Google API
I've an article on how to do this in ASP.NET and Dreamweaver
[url]http://www.charon.co.uk/content.aspx?CategoryID=30&ArticleID=55[/url]
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-
FLEQUE #3
Re: Google API
I'm using ASP/VBSCRIPT. Is there a way to modify my excisting code to work with
a navigation?
<%
Google_Web_APIs_license_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
If Request.Form("searchstring") = "" Then
Search_String = ""
Else
Search_String = Request.Form("searchstring")
End If
'
' This SOAP message came from the Google API soap-examples.
' Dump the SOAP message into an XML document and set the key value,
' search string value and start index.
'
Set objInputXMLDoc = Server.CreateObject("Microsoft.XMLDOM")
objInputXMLDoc.load Server.MapPath("google/doGoogleSearch.xml")
objInputXMLDoc.selectSingleNode("//key").Text = Google_Web_APIs_license_key
objInputXMLDoc.selectSingleNode("//q").Text = Search_String
objInputXMLDoc.selectSingleNode("//safeSearch").Text = Search_String
objInputXMLDoc.selectSingleNode("//start").Text = 1
'
' Post the SOAP message.
'
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "post", "http://api.google.com/search/beta2", False
objXMLHTTP.setRequestHeader "Content-Type", "text/xml"
objXMLHTTP.setRequestHeader "SOAPAction", "doGoogleSearch"
objXMLHTTP.send objInputXMLDoc
'showXML(objXMLHTTP.responseText)
'
' Dump the results into an XML document.
'
Set objOutputXMLDoc = Server.CreateObject("Microsoft.XMLDOM")
objOutputXMLDoc.loadXML objXMLHTTP.responseText
'
' Parse the XML document.
'
Set Nodes = objOutputXMLDoc.selectNodes("//item")
For Each Node In Nodes
Response.Write "<a href=""" & Node.selectSingleNode("URL").Text & """>" &
Node.selectSingleNode("title").Text & "</a><br>"
Response.Write Node.selectSingleNode("snippet").Text & "<BR>"
Response.Write "<font color=green>" & Node.selectSingleNode("URL").Text &
"</font>"
Response.Write "<font color=green>"" - " &
Node.selectSingleNode("cachedSize").Text & "</font>"
Response.Write "<BR>"
Response.Write "<BR>"
Next
%>
<%
Function showXML(XMLSource)
Response.Clear
Response.Write XMLSource
Response.End
End Function
%>
FLEQUE Guest



Reply With Quote

