• Really nice plugin. And if you are into data tinkering, you can retrieve post relationships from the database and build a nice blog graph / map on your own.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YARPP

    (@jeffparker)

    @xpil Thank you so much!

    We’re really intrigued — what’s the most interesting data tinkering you’ve done with YARPP? 🙂

    Thread Starter xpil

    (@xpil)

    By querying wp_yarpp_related_cache, then processing results with graphviz, you can build pretty cool blog maps, like this one for instance: https://i.imgur.com/ZOqszbZ.png

    Of course you need to fine-tune YARPP settings first as well as pick the right GV layout engine and parameters, but the results can be visually stunning.

    I can also see a potential for extending YARPP functionality with a “local map” feature that displays a small map of the blog with the current post at the center, then connected posts (and their connected posts, up to 2-3 levels) as a graph rather than a list.

    • This reply was modified 5 years, 2 months ago by xpil.
    Thread Starter xpil

    (@xpil)

    To generate graph labels, you run:

    select concat(y.reference_ID, ‘ [label=”‘, replace(regexp_replace(p1.post_title, ‘[^0-9a-zA-Z ]’, ‘ ‘), ‘ ‘, ‘ ‘), ‘”]’) ptptpt
    from wp_yarpp_related_cache y
    join wp_posts p1 on y.reference_id = p1.ID
    where p1.post_type = ‘post’
    union
    select concat(y.ID, ‘ [label=”‘, replace(regexp_replace(p2.post_title, ‘[^0-9a-zA-Z ]’, ‘ ‘), ‘ ‘, ‘ ‘), ‘”]’)
    from wp_yarpp_related_cache y
    join wp_posts p2 on y.ID=p2.ID
    where p2.post_type = ‘post’;

    Then you need post connections in a DOT format, so you run:

    select concat(y.reference_ID, ‘ — ‘, y.ID)
    from wp_yarpp_related_cache y
    join wp_posts p1 on y.reference_id = p1.ID
    join wp_posts p2 on y.ID=p2.ID
    where p1.post_type=’post’ and p2.post_type=’post’;

    Finally you wrap it in a nice .DOT file, starting with something like:

    graph {
    rankdir=LR;
    node [nodesep=2.0; fontsize=11; shape=box];
    graph [overlap=false; splines = true;];

    then your labels
    then your connections
    then a closing curly bracket

    The last step is to process the .DOT file with GV:

    sfdp ./myfile.dot -Tsvg > result.svg

    Of course you can automate the entire process. Then parametrize it with post_id, or enrich the label with tags and/or categories (using “record” label type, possibly), or build a separate map for each category (rather than post), or show links between tags (for tag-heavy websites), or build a bigger map and use it as a light post background. And so on, and so forth. The sky is the limit really.

    By the way, I am not a WordPress developer but am happy to help with the graphs if you ever need a hand. No strings attached.

    • This reply was modified 5 years, 2 months ago by xpil.
    • This reply was modified 5 years, 2 months ago by xpil.
    • This reply was modified 5 years, 2 months ago by xpil.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Been using it for years’ is closed to new replies.