Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
adammevans #1
Google Search API
I have gotten as far as I can with the coding, I am trying to run an automated
search on google for stock information, once I run the search i want to parse
of the information into a database, here's what I've put together so far, I'm
brand new at CFMX so the detail you can provide the better.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<cfinvoke
webservice="http://api.google.com/GoogleSearch.wsdl"
method="doGoogleSearch"
returnvariable="aGoogleSearchResult">
<cfinvokeargument name="key" value="JDnnCARQFHLYkutHzEbGExqZWyadiqnM"/>
<cfinvokeargument name="q" value="TSX:AC"/>
<cfinvokeargument name="start" value="0"/>
<cfinvokeargument name="maxResults" value="9"/>
<cfinvokeargument name="filter" value="false"/>
<cfinvokeargument name="restrict" value="false"/>
<cfinvokeargument name="safeSearch" value="false"/>
<cfinvokeargument name="lr" value="lang_en"/>
<cfinvokeargument name="ie" value="latin2"/>
<cfinvokeargument name="oe" value="latin2"/>
</cfinvoke>
<cfset stock_symbol = "TSX:AC">
<cfset hits = aGoogleSearchResult.estimatedTotalResultsCount>
<cfset hitdate = dateformat(now(),'mm/dd/yy')>
<cfset results = aGoogleSearchResult.getResultElements()>
<cfset curResult = structNew()>
<cfset curResult.url = results.getURL()>
<cfset curResult.title = results.getTitle()>
<cfset curResult.summary = results.getSummary()>
<cfset curResult.snippet = results.getSnippet()>
<cfset curResult.hostname = results.getHostName()>
<cfset curResult.cachedsize = results.getCachedSize()>
<cfquery name="insertStocks" datasource="aircanada">
insert into aircanada(stock_symbol,hits,hitdate,URL)
values('#stock_symbol#',#hits#,'#hitdate#','#URL#' )
</cfquery>
<body>
<strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Total
number
of hits: </font></strong> <font color="#990000" size="2" face="Verdana, Arial,
Helvetica,
sans-serif"><cfoutput>#aGoogleSearchResult.estimatedTot alResultsCount#</cfoutput</body>></font>
</html>
adammevans Guest
-
Google Search?
Anybody have the code or know how to make a Google search from a text input? -
Google Search
I haven't seen any questions/response about this, and searching for it returns 0 hits. I would like to have an internet search area on my site,... -
Info on Google search results
Hey Guys, Google search results sometimes come back with extra information just below the name of the web site; for example, if you Google the... -
Simple Google search
I'm trying to develop a search page for my website, but rather than using Verity I want to use Google. I have a search box in my cfm.dwt.template... -
Keep Google search hits despite PHP??
While in the process of reorganizing my company's website and I created a database of all their publications. I replaced their old html...



Reply With Quote

