[htdig] [Q]: Hacking source, advice please (adding search date ranges)


mike grommet (mgrommet@insolwwb.net)
Fri, 26 Feb 1999 12:53:45 -0600


Hi guys, you might remember my posting of a few days ago concerning the idea
of allowing
a searching individual to specify date ranges to search by. It should be an
easy concept to hack in
and one that would prove useful to others I think.

Since the date of a document is contained in its last modified date header
returned by the web server
(as I understand it), and is stored in the database, I wish to use this to
avoid having to hack
any of the existing data structures.

I've done quite a bit of C, and a little C++, plus there is quite a bit of
source to go through
to find what should be changed, so if anyone could provide assistance I
would be very appreciative

Seems to me, I have to hack htsearch to accept two new parameters,
say begindate and enddate.

Ok, from looking at the source, I need to embed the checking for these
parameters inside
htsearch.cc on or about lines (around 156ish)

   if (input.exists("method"))
        config.Add("match_method", input["method"]);
    if (input.exists("format"))
        config.Add("template_name", input["format"]);
    if (input.exists("matchesperpage"))
        config.Add("matches_per_page", input["matchesperpage"]);
    if (input.exists("page"))
        pageNumber = atoi(input["page"]);
    if (input.exists("config"))

ok, now knowing this, and getting the right information for the parameters,
and of course making sure its in the time_t format, I'm really not quite
sure where I need to place the check for acceptance and recjection based on
the time issue...

Any ideas here?

This seems to be a very useful concept, maybe this could be merged into the
regular distribution?
I plan on disclosing any changes here for public scrutiny, as I am
absolutely certain there are better programmers out there than I, but hey, I
guess I've always wanted to contribute to an open source project, so here I
am :)

------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig@htdig.org containing the single word "unsubscribe" in
the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Fri Feb 26 1999 - 14:34:13 PST