Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Going through the links pointing to external sites is also interesting to scan for spam links, hence this is indeed desireable.

I currently lack the time to do it myself, and database access is somewhat scarce, but the relevant DB schema is (roughly):

create table node ( node_id integer not null unique primary key, type_nodetype integer not null references node, author_user integer not null references node, lastedit timestamp ); create table user ( user_id integer not null references node ); create table note ( note_id integer not null unique primary key references node(node_i +d), doctext text not null default '' );

And Real, Working SQL to query these tables is (also at Replies with outbound links, but that's for gods only to access):

select node_id, doctext from node left join document on node_id = document_id where lastedit > date_sub( current_date(), interval 10 day ) and type_nodetype = 11 -- note and doctext like '%http://%' order by lastedit desc

This SQL should be refined to also catch https:// links, and then some Perl code needs to be written to verify that the text is an actual link.

Test cases for text with links would be for example:

<p>It's right [ +il-pmilter-1.20_01|here].</p> --- <a href="">Groklaw</a> --- [href://|Monastery Tutorials]

Negative test cases would be:

<P><A></ +A></P> --- "http://localhost:3000"

Ideally, we will be able to refine this code later to highlight outbound links that are not on the whitelist of Perlmonks links.

In reply to Re: Solving possible missing links by Corion
in thread Solving possible missing links by talexb

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (4)
    As of 2020-10-23 03:30 GMT
    Find Nodes?
      Voting Booth?
      My favourite web site is:

      Results (234 votes). Check out past polls.