• Post Reply Bookmark Topic Watch Topic
  • New Topic

Searching Google from a Java App  RSS feed

 
Ben Pateman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

Been trying to figure this out for a while now, but can't seem to get my head around it. The problem I'm having is that web interaction seems to be such a huge domain, that I'm worried I'm taking the wrong approach and there's actually a much simpler way to do this.

All I'm trying to do is perform simple google searches from my application; the only data I'm interested in getting back is the number of results each search has. I've tried following a few web services tutorials, but these mostly seem to lead towards creating web apps rather than interacting with existing APIs. I've played around with Google Web Toolkit, but after setting it up and everything it didn't seem to be what I needed. Also tried using the .net java API, but I had no luck with it whatsoever.

Does anyone have any tips or advice to help point me in the right direction? I'm an experienced java programmer but this is my first venture into web service stuff, and I feel completely lost!

Many thanks
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you're looking for is probably the Google Search Appliance API. You might want to look at the GSA-JAPI for Java too.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

First off, you're right - GWT has nothing to do with running Google searches.

If this was my problem, I'd use jWebUnit for this. It's billed as a web testing framework (for JUnit), but it works just fine as a general purpose web access library. The "Quick Start" page has examples of how to submit forms (like the Google search form).

You could then use WebTestCase.getPageSource to get the full page source and find what you're looking for with a regexp.

Update: Just saw Charles' response, but I don't think it applies to your problem. At least I see nothing in the post that suggests a Google Appliance (which is a hardware device) is involved.
[ December 13, 2008: Message edited by: Ulf Dittmer ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!