Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to search all urls (websites)

2 views
Skip to first unread message

lova...@gmail.com

unread,
Aug 18, 2005, 4:21:58 AM8/18/05
to
hi,
IAm new to GoogleAPi..
I want to search all the links/urls present in a website . I will give
a webpage url Googleapi has to return me the all the links present in
that webpage.
How can I do it..
I know the command "java -cp googleapi.jar
com.google.soap.search.GoogleAPIDemo <key> search <serach word>" . By
doing any modifications to this will I get my output or Is there any
other method...
thanks in advance....
waiting for ur reply....

justncase80

unread,
Aug 19, 2005, 9:17:49 AM8/19/05
to
The google API won't give you the links in a website inherently it will
only give you the websites. Here is a link to a class I wrote in C#
that will extract all the links of a website given a URL:
http://justinchase.is-a-geek.com/Code/Extractor.cs

And you can download my API wrapper that I wrote in C# here:
http://justinchase.is-a-geek.com/Code/GoogleEngine.zip

It will have some easy to understand examples of how to do the query
and if you're using .NET at all you can just build it as an assembly
and even use it!

~Justin

lova...@gmail.com

unread,
Aug 20, 2005, 1:01:59 AM8/20/05
to
hi,
wat is the difference between links and websites...

bye,
lovakumar.

abrud...@gmail.com

unread,
Aug 30, 2005, 6:13:28 PM8/30/05
to
What does your wrapper return as results? Better put, how do you
display results using your wrapper?

justncase80

unread,
Aug 31, 2005, 3:48:38 PM8/31/05
to
To recieve results with my wrapper you would first create an instance
of the Engine object like this:

GoogleEngine.Engine TheEngine = new GoogleEngine.Engine();

Then you want to create event handler functions for the various events
the Engine creates:

TheEngine.QueryComplete += new
GoogleEngine.QueryCompleteEventHandler(QueryComplete);
TheEngine.StatusMessage += new
GoogleEngine.Engine.StatusMessageEventHandler(StatusMessage);

To do the query in your Main function:
string query = "joey chandler monica"
TheEngine.Query = query;
TheEngine.DoQuery();

You can also do this in a separate thread (that is why I did it this
way) like this:
Thread t = new Thread(new ThreadStart(QueryComplete));
t.start();

Then Declare the event handler functions:

public void QueryComplete(object o,
GoogleEngine.Engine.QueryCompleteEventArgs e)
{
int rank = TheEngine.Start;
System.Console.WriteLine("Results:");
for(int x=0;rank<e.Result.resultElements.Length;x++)
{
System.Console.WriteLine(Convert.ToString(1+rank++) + ".) " +
e.Result.resultElements[x].URL);
}
}

public void StatusMessage(object o,
GoogleEngine.Engine.StatusMessageEventArgs e)
{
System.Console.WriteLine(e.Message);
}

The spell checking is also the same way pretty much. You also have to
put your key into the engine before you call DoQuery.

You can find other examples and nDoc documentation on my web site at
http://www.d.umn.edu/~chas0084/UROP/

There is also extra support in the library for the built-in language
and location restrictions Google has. Some of the restrictions have
weird codes that are hard to memorize but I created (huge) enumerations
designed for converting Readable country names into the google restrict
codes. That is pretty useful for anyone wishing to search sites from
other countries and in other languages.

lova...@gmail.com

unread,
Sep 4, 2005, 4:24:34 AM9/4/05
to
though I am not sure using "allinlinks: " and "site: "
attributes in query we can do it. still Iam unable find out the
correct syntax for it...

Do u have the java code for the C# code u given in the link...

bye.

justncase80

unread,
Sep 5, 2005, 1:33:13 PM9/5/05
to
Sorry, I don't. I'm messing around with the allinlinks and can't get it
to work either... it seems to not work at all. weird.

0 new messages