lynx-dev
[Top][All Lists]
Advanced

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

Re: [Lynx-dev] Passing url to jumps?


From: Robert Mortimer
Subject: Re: [Lynx-dev] Passing url to jumps?
Date: Mon, 19 Jan 2009 22:41:41 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

Hi,

        Just to follow up on this a bit, as mentioned previously jumps
don't pass on a refferer header so you can't use that to pass on the
current URL to a new url as as tinyurl or kaboodle or digg etc. 

So I cam up with two partial answers both of which are a bit ugly.
If I don't really need to get a response to the URL being passwed on I
can use a printer ( I'm using this to allow people to create individual
bookmark files on a public lynx client ) This one's the simple one I
just use the printer script to pass on the LYNX_PRINT_URL variable,
along the lines of:
#!/bin/sh
name=$2
echo "<li><a href=\"$LYNX_PRINT_URL\">$name</a></li>" >> file

But that doesn't really help with the digg etc. problem, so my current
really really ugly answer ( and I apologise to people that can
actually code for this ) is to append ':URL' to the relevent jump urls
and then use this:

diff -u LYMainLoop.c LYMainLoop.c.N             
--- LYMainLoop.c        Thu Jan  1 01:22:26 2009
+++ LYMainLoop.c.N      Mon Jan 19 21:04:46 2009
@@ -3443,6 +3443,11 @@
                LYRemoveBlanks(user_input_buffer);
            }
            set_address(&newdoc, ret);
+            /* RM ugly hack to append current url to specific jumps  
*/
+            if ( strstr( newdoc.address, ":URL\0") != NULL) {    
+                 newdoc.address[strlen(newdoc.address) -4] = '\0';
+                 strcat(newdoc.address,curdoc.address);
+            }
            StrAllocCopy(lynxjumpfile, ret);
            LYFreePostData(&newdoc);
            FREE(newdoc.bookmark);

I did try looking for a marker on the jump short cut so if the
shortcut was l then l! would append the current URL which would be
much neater but I had problems getting it handled properly, especially
in properly clearing it afterwards. So kind of had to give up on that.

I think such a function would be really handy and if there is a way to
do this that I've missed, please let me know.

Ta.

-- 
Robm
873
  "Ask not what I can do for the stupid, 
         but what the stupid can do for me" - Graeme Garden




reply via email to

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