Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

An Idea for hiding

by chip (Curate)
on Nov 28, 2001 at 01:46 UTC ( #127927=monkdiscuss: print w/ replies, xml ) Need Help??

I really hate "lastnode=" in monastery URLs -- it messes up history and link coloration.

If I remember correctly, it's possible to include query parameters in the body of the request, a la POST, even if there are also parameters in the URL itself. Therefore, a query could look like this:

GET /index.pl?node=1234 Content-Type: text/plain [...etc...] lastnode=5678

This preserves lastnode as a parameter without polluting the URL.

What say you give it a try? Tim? Please??

    -- Chip Salzenberg, Free-Floating Agent of Chaos

Comment on An Idea for hiding
Download Code
Re: An Idea for hiding
by chip (Curate) on Nov 28, 2001 at 01:51 UTC
    And if that doesn't work, then the node can be encoded into the URL in a way other than as a query parameter, say as perlmonks.org/node/1234, and lastnode can be in the body of the GET as shown above.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

      Only the POST method allows for an entity body in the request. You can mix "GET"-style parameters with POST data in a POST request, but not vice-versa.

      Though your post does brings up a good point regarding the usability of URL's. All of this extra cruft in the URL parameter list is really generally unnecessary. I would personally love to see more usable URL's of the form:

      http://perlmonks.org/node/an.idea.for.hiding or http://perlmonks.org/node/Re:%20an%20idea%20for%20hiding or http://perlmonks.org/node/1234 as you suggest
      The rest of the junk we see in the URL can generally be obtained through more reliable (and less obvious) means.
Re: An Idea for hiding
by chip (Curate) on Nov 28, 2001 at 02:00 UTC
    The ever-helpful tilly also suggests that index.pl could just be parsing HTTP_REFERER to get lastnode, allowing it to be omitted entirely. This is by far the best approach I've so far seen.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

Re: An Idea for hiding
by belg4mit (Prior) on Nov 28, 2001 at 04:13 UTC
    ++ for everyone! I'd actually been thinking about this (HTTP_REFERER) included but it got lost in the mental clutter. I've bookmarked a load of nodes recently and it occured to me that this would be skewing any kind of stastics being gathered based on fetched URL's.

    --
    perl -p -e "s/(?:\w);([st])/'\$1/mg"

Re: An Idea for hiding
by gt8073a (Hermit) on Nov 28, 2001 at 13:39 UTC

    HTTP_REFERER is set by the client, so it may produce strange results( 127.0.0.1 or www.nsa.gov for instance ;). not that mucking around with the url won't produce strange results.

    if you set some user session data to lasnode_id, what happens when a user opens links in new windows? you still need to figure out which "window", or node, the user came from.

    saving each node_id / lastnode_id pair generated can grow really big really quick, seeing how there are almost 13000 nodes( i think ).

    while i agree with chip's statement about urls not morphing, i don't see any simple, reliable alternatives. besides, any statistics gathered from site usage should alot for bookmarks and such.

    Will perl for money
    JJ Knitis
    (901) 756-7693
    gt8073a@industrialmusic.com

      Even if REFERER isn't reliable, it's good enough for casual statistics, IMO. And I think that's all that vroom is currently using it for....

          -- Chip Salzenberg, Free-Floating Agent of Chaos

Re: An Idea for hiding
by Chady (Priest) on Nov 28, 2001 at 22:25 UTC
    "I really hate "lastnode=" in monastery URLs -- it messes up history and link coloration. "

    Correction: I live behind a proxy server that caches the hell out of everything... so every site I want to browse I have to refresh at least twice before the proxy decides to get the real page. This happens everywhere but at the monastery, why? because every page is linked in always a diffrent way.. and if you like link coloration that much.. I suggest you download a free copy of Opera and set up a user style.... and browse happily ever after.


    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/
      I can reply only with a quote from the Sayings of Chairman Larry:

      "I do quarrel with logic that says, 'Stupid people are associated with X, therefore X is stupid.' Stupid people are associated with everything."

          -- Chip Salzenberg, Free-Floating Agent of Chaos

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://127927]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2014-08-21 18:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (141 votes), past polls