The mp-wp bot job offer

Earlier in the logs...

mircea_popescu: so : who would like to do a spot of work for hire for me ? the ideea is to write and publish as a vpatch a stan logbot extension which

a) processes search, through talking to a [presumably present] mysql server, and spitting out the results (formatted as in http://trilema.com/2019/ except with also excerpt consisting of prefix / suffix one dozen words around each search term, separated by [...] magic string) as html files (date-time-terms.html) in a special /<botname>-search directory

b) takes irc trackbacks, to any article from trilema mentioned in the logs, the line where it was mentioned as text and the url to the logotron

c) deploys this to pizarro box (should be getting one presently i'm understanding) -- this step will also include putting a trilema clone in there (i'll provide the mp-wp install/db dumb, all that's needed is a mysql glue such that local myql server slaves trilema.com mysql server ; i intend to make a one line edit to the forms, such that comments left on what will be trilema.org get posted to trilema.com instead, and that's that).

[d] mircea_popescu: thinks asciilifeform should also get something ; though it's unclear how exactly to figure this out. but -- lacking a better idea, i guess he can have 10% of the winning bid in royalties and we see.

[e] mircea_popescu: (ftr, this being a purely apache job, i do expect to see flask and crap taken out ; but othrweise no problem having actual channel sitting bot in python, doesn't hafta be rewritten or anything like that.)

[f] mircea_popescu: (perfectly acceptable for logger part of bot to consist of simply updating article in mpwp-posts, tagged as "logs" category, have one for each day. mp-wp will do the rest.)

[g] mircea_popescu: i think that just about covers it, hopefully.


Let me now see if I've properly digested this ask, by asking some clarifying questions and/or statements!

a)

I think I get this bit. The bot will sit in IRC, and someone can issue an e.g. "!q search slut". The bot will then hit the mysql database on whatever box it is running on, and issue a bunch of queries for "slut" against a slaved copy of Trilema (or whatever blog it is implemented for). It then will shit out the results as static html files into the /<botname> dir on the same box. Is this a correct understanding?

Now, I'm kinda fuzzy on the formatting specifics, so I want to clear those up. Let's run with the "slut" example, but add another search term to demonstrate more than one. Would you be looking for something like this?: http://blog.lobbesblog.com/static/2019-09-08-2302-slut-anyway.html

Note that in the first search result, everything comes out kinda "clean", but in the second result ("Fuck Argentina") we see lots of "overlap" in the buffer text. Is this okay or is it not wanted? Not sure how "smart" we want the prefix / suffix to get.

Also, is the "bare bones" or "Qntra-style" formatting of the html files acceptable? I would suggest that this is a good idea, both for low file sizes and for "style portability" across other people who may implement this extension on their own blogs. Idk, I'm open for ideas.

b)

This ties into [f] I take it? In other words, as each day goes on the bot eats any references to trilema, and then posts a new article / updates the article for that day via the mysql database, and adds all loglink/article references to said article (thus triggering the pingbacks mechanism on the mp-wp part. This is a great idea I am realizing!)

c)

I think I covered most of this in a) above, but let me also clarify that part of this ask will be to also implement this for you on your eventual pizarro box?

Unrelated, but I can envision that I will be testing this as well on my own boxen (probably with an aim to get an implementation running for my own blog).

[d] I agree! If I win the auction I would even be open to giving the man moar than 10%, if he so wanted. This very discussion wouldn't even be possible without his quick wartime efforts and continued maintenance.

[e] Sounds reasonable

[f] Covered in b) !

After writing out these questions and thinking on it, I have a better understanding already (I hope). I think I'ma gonna go ahead and bid. The magic of structured thought.

7 Responses to “The mp-wp bot job offer”

  1. > db dumb

    Keks. Needless to say, this'll be the dump such as it is, dumb or otherwise.

    > and someone can issue an e.g. "!q search slut"

    With actual examples (taking as a working example the jellybean docket, a delightful little piece I had meanwhile forgotten -- nor do I remember who the fuck were the participating sluts ; but in any case I'm pretty sure they'd take umbrage to being called slut by anyone besides than me) :

    if seaching for docking grape makes a the expected result should look like

    The jellybean docket
    24 February 2017 | Author: Mircea Popescu

    H (looking around): Then they dock ya!? P: I am docking you...one and three-fourths jelly beans. H: That's not so bad. Do you know [...] Malinche: What flavor was it? H: Thirty years! Grape. M: You remember what flavor! P: What was the worst [...] was this orangey but very lightly jelly, in this shape (makes a crescent with his finger), covered in very thin chocolate. It was good! They came like 20, 30 to a box, it had fresias painted

    Category: Trilterviuri | One response

    I think you get the idea ?

    O fucking hell. Yes, evidently you got the idea, by your example. Well done!

    /me sings... non, rien de rien, je ne regrette rien, pas le mal, pas perdre du temps a travailler inutilement... c'est pas inutilment... lalala...

    > Not sure how "smart" we want the prefix / suffix to get.

    We'll worry about this afterwards.

    > Also, is the "bare bones" or "Qntra-style" formatting of the html files acceptable?

    Actually, no, I want the trilema formatting, hence the reference to that archive page.

    > as each day goes on the bot eats any references to trilema, and then posts a new article / updates the article for that day via the mysql database

    No, two different things.

    Thing 1 : every time the bot sees a trilema article referenced on the log, it produces a trackback. As if a fucking blog had mentioned it. This is blogification of irc, if you will, the freenode servers are too dumb to send trackbacks (as they ABSOLUTELY MUST, as per the standard of the internet, if you link to something you must notify the something, NOT optional) so we have to write bots of our own to fix their failings.

    Thing 2 : the current output of the logger, as seen in eg http://logs.ericbenevides.com/log/trilema/2019-09-07#1934613 ; will be spit out ~as an article~ into the trilema database. In a special category of its own (logs). So that trilema by default also includes a complete log of #trilema, see ?

    > part of this ask will be to also implement this for you on your eventual pizarro box?

    Well yes, the deliverable is working code on provided machine, as opposed to ... anything else.

  2. lobbes says:

    > but in any case I'm pretty sure they'd take umbrage to being called slut by anyone besides than me

    Juuust in case this wasn't clear, I sure as hell wouldn't be walking into casa de MP (or anyone else's casa, for that matter) and calling his girlies anything other than what I was told to call 'em. I'd fully expect to be strung up by my entrails otherwise.

    Mind that I'm a data analyst at heart, so I was only seeing disembodied strings in a dataset (and figured I'd use some terms that ol' MP may be searching for). In any case I'll stick to jellybean examples going forward. If any offense was taken, rest assured it was not intended.

    > Yes, evidently you got the idea

    Word! Ty for confirming.

    > Actually, no, I want the trilema formatting, hence the reference to that archive page.

    Aite. In this case, would you mind lending me your theme.php (can't recall the filenames) from your mp-wp implementation? Not sure how to approach this yet, but figure that might help.

    > Thing 1 : every time the bot sees a trilema article referenced on the log, it produces a trackback.

    I think I got this then. So in other words, the bot will literally perform the same damn thing that a normal trackback would do, except for irc references.

    > Thing 2 : the current output of the logger, as seen in eg http://logs.ericbenevides.com/log/trilema/2019-09-07#1934613 ; will be spit out ~as an article~ into the trilema database. In a special category of its own (logs). So that trilema by default also includes a complete log of #trilema, see ?

    Ahhh okay. The logline output of #trilema will literally be daily articles on Trilema.com (under "logs" category). Coolio!

    Ty for the clarification

  3. > would you mind lending me your theme.php

    This is where it can get gnarly, without it having to. So let's try and intelligently sidestep some gnarl thereby realising an important economy of insanity.

    In any mp-wp theme, the content is actually displayed by calls to specialised files : single.php (for a single page, like this article), page.php (for dedicated pages), archive.php (for archives), categories.php (you guessed it), etc.

    Since the "like archives" format was indicated we'll be using this last one ; but it matters relatively little, because they all consist of the same thing : a wrapper () followed by the actual substance :

    $query = 'SELECT blablabla';
    $record=mysql_query($query);

    while ( $row = mysql_fetch_array($record, MYSQL_NUM)) {

    echo '';
    echo '',$row[3],'';
    echo '',date("j", strtotime($row[2])),$months[(int)date("m", strtotime($row[2]))],$year,' | Author: Mircea Popescu';
    echo 'Category: ',$row[7],'';

    if ($row[6] == 0) $commlink = "Leave a response";
    if ($row[6] == 1) $commlink = "One response";
    if ($row[6] > 1) $commlink = $row[6]." responses";

    echo ' | ',$commlink,'';
    echo '';

    }
    ?>

    So : write down ~whatever code you need~, stick a atop it, call it logs.php and be totally fucking done with this.

    "Made for to make anyone a programmer", or how did that go -- the myspace language has the advantage any nine year old girl mentally active enough to even like a band in the first place has all she needs in the noggin to make her own page.

    > the same damn thing that a normal trackback would do

    Yes. Specifically : http://trilema.com/2015/how-to-fix-your-local-trackbacks/

    > will literally be daily articles on Trilema.com

    Yup. Nothign to this, either : just insert into mp-wp.posts the actual log content, and mp-wp does the rest. All the rest.

  4. > would you mind lending me your theme.php

    This is where it can get gnarly, <em>without it having to</em>. So let's try and intelligently sidestep some gnarl thereby realising an important economy of insanity.

    In any mp-wp theme, the content is actually displayed by calls to specialised files : single.php (for a single page, like this article), page.php (for dedicated pages), archive.php (for archives), categories.php (you guessed it), etc.

    Since the "like archives" format was indicated we'll be using this last one ; but it matters relatively little, because they all consist of the same thing : a wrapper (<?php get_header(); ?>) followed by the actual substance :
    <code>
    $query = 'SELECT blablabla';
    $record=mysql_query($query);

    while ( $row = mysql_fetch_array($record, MYSQL_NUM)) {

    echo '<div id="post-'.$row[0].'" class="post">';
    echo '<div class="title"><a href="http://trilema.com/'.date("Y",strtotime($row[2]))."/".$row[5].'" rel="bookmark" title="Permanent Link to ',$row[3],'">',$row[3],'</a></div>';
    echo '<div class="date">',date("j", strtotime($row[2])),$months[(int)date("m", strtotime($row[2]))],$year,' | Author: Mircea Popescu</div><div class="clear"></div>';
    echo '<div class="info"><span class="category">Category: <a href=http://trilema.com/category/',$row[8],'>',$row[7],'</a></span>';

    if ($row[6] == 0) $commlink = "Leave a response";
    if ($row[6] == 1) $commlink = "One response";
    if ($row[6] > 1) $commlink = $row[6]." responses";

    echo ' | <span class="bubble"><a href=http://trilema.com/',$year,"/",$row[5],'/#respond>',$commlink,'</a></span>';
    echo '</div><div class="info_bot"></div></div>';

    }
    ?></code>

    So : write down ~whatever code you need~, stick a <?php get_header(); ?> atop it, call it logs.php and be totally fucking done with this.

    "Made for to make anyone a programmer", or how did that go -- the myspace language has the advantage any nine year old girl mentally active enough to even like a band in the first place has all she needs in the noggin to make her own page.

    > the same damn thing that a normal trackback would do

    Yes. Specifically : http://trilema.com/2015/how-to-fix-your-local-trackbacks/

    PS. Restated, because apparently your blog eats things within code tags.

  5. > would you mind lending me your theme.php

    This is where it can get gnarly, <em>without it having to</em>. So let's try and intelligently sidestep some gnarl thereby realising an important economy of insanity.

    In any mp-wp theme, the content is actually displayed by calls to specialised files : single.php (for a single page, like this article), page.php (for dedicated pages), archive.php (for archives), categories.php (you guessed it), etc.

    Since the "like archives" format was indicated we'll be using this last one ; but it matters relatively little, because they all consist of the same thing : a wrapper (<?php get_header(); ?>) followed by the actual substance :
    <code>
    $query = 'SELECT blablabla';
    $record=mysql_query($query);

    while ( $row = mysql_fetch_array($record, MYSQL_NUM)) {

    echo '<div id="post-'.$row[0].'" class="post">';
    echo '<div class="title"><a href="http://trilema.com/'.date("Y",strtotime($row[2]))."/".$row[5].'" rel="bookmark" title="Permanent Link to ',$row[3],'">',$row[3],'</a></div>';
    echo '<div class="date">',date("j", strtotime($row[2])),$months[(int)date("m", strtotime($row[2]))],$year,' | Author: Mircea Popescu</div><div class="clear"></div>';
    echo '<div class="info"><span class="category">Category: <a href=http://trilema.com/category/',$row[8],'>',$row[7],'</a></span>';

    if ($row[6] == 0) $commlink = "Leave a response";
    if ($row[6] == 1) $commlink = "One response";
    if ($row[6] > 1) $commlink = $row[6]." responses";

    echo ' | <span class="bubble"><a href=http://trilema.com/',$year,"/",$row[5],'/#respond>',$commlink,'</a></span>';
    echo '</div><div class="info_bot"></div></div>';

    }
    ?></code>

    So : write down ~whatever code you need~, stick a <?php get_header(); ?> atop it, call it logs.php and be totally fucking done with this.

    "Made for to make anyone a programmer", or how did that go -- the myspace language has the advantage any nine year old girl mentally active enough to even like a band in the first place has all she needs in the noggin to make her own page.

    > the same damn thing that a normal trackback would do

    Yes. Specifically : http://trilema.com/2015/how-to-fix-your-local-trackbacks/

    > will literally be daily articles on Trilema.com

    Yup. Nothign to this, either : just insert into mp-wp.posts the actual log content, and mp-wp does the rest. <b><a href=http://logs.nosuchlabs.com/log/trilema/2019-09-07#1934437>All</a></b> the rest.

    PS. Restated for the 2nd (and final time) because apparently previous restatement was an earlier draft.

  6. lobbes says:

    Ty, this makes much more sense now. I've got some stuff to chew on now.

  7. [...] case, my life would be on the fast-track to writing blog posts on Toy Story 4 instead of working on interesting projects with cool people. I couldn't live with that choice whereas I can live with this one, as much as I [...]

Leave a Reply