Hey guys and gals,
I have a very simple problem and have literally no idea how to proceed as I really have not done much c++, I am more of a PHP man :).
I would like to know how to make Lynx follow meta refresh links automatically, At the moment it just provides a "clickable" link you can accept the refresh. I would like this to be automatic.
--- Initial problem ---
We have a DB Backup script written in PHP/HTML and uses the page refresh to loop the backup (every 2 minutes). Using a full fledged browser is not really an option on our machine as the resources are very tight. So we tried Lynx and it has the perfect footprint but the only problem is it doesn't refresh the page.
--
I'm thinking I just need some way to force Lynx to reload the page after the time has elapsed. Maybe create a new function that starts a timer and hold the url until the timer ends then force Lynx to visit that url. Im a PHP Procedural kinda guy and I cant think how to set this timer event safely without corrupting or crashing the program or creating memory leaks.
Please any advice would be extremely appreciated, I wish had time to learn c++ properly but working 10+hours a day it is an impossibility atm.
Thanks again!
(source code im using:
http://lynx.isc.org/current/lynx2.8.8rel.2.tar.bz2)
This is the function that handles meta refresh.
I really have no idea If i need to edit header files or anything :(
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
/*
* Given a refresh-URL content string, parses the delay time and the URL
* string. Ignore the remainder of the content.
*/
void LYParseRefreshURL(char *content,
char **p_seconds,
char **p_address)
{
char *cp;
char *cp1 = NULL;
char *Seconds = NULL;
/*
* Look for the Seconds field. - FM
*/
cp = LYSkipBlanks(content);
if (*cp && isdigit(UCH(*cp))) {
cp1 = cp;
while (*cp1 && isdigit(UCH(*cp1)))
cp1++;
StrnAllocCopy(Seconds, cp, (size_t) (cp1 - cp));
}
*p_seconds = Seconds;
*p_address = LYParseTagParam(content, "URL");
CTRACE((tfp,
"LYParseRefreshURL\n\tcontent: %s\n\tseconds: %s\n\taddress: %s\n",
content, NonNull(*p_seconds), NonNull(*p_address)));
}
|