-1

I need to return the top ten Google results, and want to use ColdFusion to do this.

I haven't used ColdFusion before so I don't know where to start. Any suggestions on what tags or functions to use, and any links to documentation on performing Google searches would be greatly appreciated.

Also, I need the final list not to have any places listings in them.

Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
  • 1
    How is this "not a real question"?! It might not have been worded as well as it could be, but it's _obvious_ what has been asked, especially given the fact that it received two clear answers. **New users should be given feedback** before people bundle in and vote to close a valid question. – Peter Boughton Sep 01 '11 at 13:57
  • @Peter: No, this is not a good question. The OP clearly hasn't tried *anything at all*. He's asking us what key words to search for instead of asking us a specific programming question. – Bill the Lizard Sep 01 '11 at 14:36
  • Bill, I didn't say it was a good question. I said what the OP is asking (how to search Google using ColdFusion) is a valid thing to ask. The way it was asked wasn't good, and the mistakes that Ande made should be explained as feedback to them so they can improve - instead of closing _without any comments at all_. All five voters failed to do this (I'd like to flag this up to those users, but didn't want to be seen as antagonistic, and no idea if they'd get notified anyway). – Peter Boughton Sep 01 '11 at 15:29
  • just wondering why you would even need ColdFusion to do this, when you could probably do this easily using ajax via jquery. – rip747 Sep 01 '11 at 18:37
  • @Peter: They're not obligated to comment. The close reason explains it. "It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form." – Bill the Lizard Sep 01 '11 at 19:51
  • Of course they're not obligated, but closing questions for the sake of it isn't helpful. (None of them are active in this tag; only one has ever even answered a cf-related question, so it doesn't affect them if the question is closed or not.) – Peter Boughton Sep 02 '11 at 00:54
  • I disagree that the close reason explains satisfactorily what needs improving with this question. There _is_ a real question, it is not difficult to tell what it is, it's not ambiguous, vague, overly broad, nor rhetorical. It could be considered incomplete, but it still obtained two answers before it was closed, and might have had another (rip's "do it with jQuery" suggestion) if it was still open. I've seen plenty of worse questions appear on SO, only to be edited in to shape due to constructive comments. – Peter Boughton Sep 02 '11 at 00:57
  • I've had a quick go at re-wording the question. Hopefully the OP hasn't been put off by the rapid unhelpful closing, and can come back and expand the question further (such as to explain whether a JS version would be better, or if server-side is required), and also isn't deterred from asking questions in future. – Peter Boughton Sep 02 '11 at 00:57

2 Answers2

5

Read up on <cfhttp>, DeserialzeJSON(), and Google's JSON Custom Search API at http://code.google.com/apis/customsearch/v1/overview.html

Henry
  • 32,689
  • 19
  • 120
  • 221
1

Sign up and start a Google Custom search API. This wil giv you your API key.

Create a custom search to get the cx id

Then use:

<cfhttp method="get" url="https://www.googleapis.com/customsearch/v1?key=YOURKEY&cx=YourID&q=ColdFusion" result="r" />

<cfdump var="#deserializeJSON(r.filecontent)#" />