Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How to get raw node content

by huck (Vicar)
on Sep 15, 2017 at 19:53 UTC ( #1199477=note: print w/replies, xml ) Need Help??


in reply to How to get raw node content

When i want to do that i just use the "view page source" option in my browser. If that is still too much you may want to try adding displaytype=print ie http://www.perlmonks.org/?node_id=1199455&displaytype=print and then "view page source"

Replies are listed 'Best First'.
Re^2: How to get raw node content (whitespace and nodelet hack)
by LanX (Bishop) on Sep 16, 2017 at 15:06 UTC
    Actually your approach is better to see whitespaces and linebreaks directly inside the browser, since the XML view in FF doesn't show it.

    FWIW here a nodelet hack which opens a JS.alert() with the HTML of the post you are trying to reply to.

    <script><!-- function show_quote() { alert(document.querySelector("div.preview").innerHTML.match(/^[^]*?(?= +<hr> <div class="editnodetext">)/)[0]); } --></script> <a href='javascript:show_quote()'> show_quote</a>

    (you need to be in a "comment on" node to make it work)

    it was part of my plans to extend my wiki-syntax with comfortable quoting of a users post...

    ... of course milking the XML-displaytype would be more reasonable here.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Re^2: How to get raw node content
by LanX (Bishop) on Sep 15, 2017 at 20:44 UTC
    Sorry for nitpicking ...

    ... it's very close but that's not the raw input of the poster.

    For instance [links] are expanded and code tags have an extra download link.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Re^2: How to get raw node content
by roboticus (Chancellor) on Sep 15, 2017 at 21:02 UTC

    huck:

    Thanks, but that still has the HTML entities encoding and bracket ([ ]) munging.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      How raw can we get?

      lynx -dump http://perlmonks.org > dump.txt

      Lynx?

      Best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

        I think you are missing the point, compare the data inside the xml link with the produced html.

        For instance you can see find* the original line breaks and indentation in the raw form if a poster forgets surrounding code tags

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Je suis Charlie!

        *) The xml view inside FF doesn't display the (included) line-breaks, but if one's copy the content to an editor it becomes visible again.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199477]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2017-10-21 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (269 votes). Check out past polls.

    Notices?