lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev How to get all the lynks in a page ?


From: HATTON Nicolas
Subject: lynx-dev How to get all the lynks in a page ?
Date: Wed, 29 Jul 1998 15:07:05 +0200

Hi everybody.

I'm trying to modify the sources a Lynx2.8dev.5 in order to add a new
functionality(*). I configure a specific URL in lynx.cfg and I need to
store all the links within the page in a (char **) array when this URL
is called.
I tried to use the nlinks variable and the links[] array (LYMainLoop.c)
but they are screen-oriented, ie they only give information about the
displayed part of the page, and I need this information for the entire
document.
I'm now looking at GetFile.c and the HText structure but this source
code (although quite well commented) is hard to follow (for me :) ).
It would be nice if the source code gurus could give me a hint about
where to find these informations easily. Maybe when the document is
loaded  (I tried to follow the getfile() function down to HTLoad() in
HTAccess.c but I can't really see how does it work)  ?

So, if I summarize :

Get the new document
if ( !stricmp(curdoc.address, MY_URL_IN_CFG) )
{
        Store all the links in an array
}

I'm not sure that this question is appropriate, but I'm trying anyway.

Thanks for any information...
        Nicolas Hatton

(*) WHY ? : I'm doing this all alone without notifying the dev team
because I believe this functionality is too much bound to our project
needs to be included in a general Lynx release : the main idea is being
able to dynamically map some keys to URLs which appear in a dynamically
generated HTML page.
Let's say that the page "server/test.html" is a list of links
dynamically generated by a script (CGI, Notes, ...). I've got something
like that in my lynx.cfg :
MY_URL:http://server/test.html
KEY_URL:a:URL1
KEY_URL:b:URL2
...
Every time test.html is generated, 'a' is mapped to the first URL (link)
of test.html, 'b' the second, etc... Then I can navigate through these
different URLs without going back to test.html between the pages. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]