Giter Site home page Giter Site logo

perlbuut's Introduction

What this does

There's two branches involved, the site itself and the rendered pages. In this particular repository they are 'main' for the site source code and 'published' for the rendered pages. These are both customizable. The github action here will check the .env file for those branches and only do the work when on a PR for the site branch or when things are merged into the site branch.

How to customize for your own github pages setup

Take a look at the .env file to set the branches in use. The two branches are the one for the source of the site and the branch to publish the site to.

The way this system works is that it runs statocles in a github action and pushes the rendered site to a different branch on the same repository.

How to update pages

carton install

then use ./build.sh to do a test build of the site and ./serve.sh to start a daemon serving the site up on port 3000 to see the full site in a browser

Past that you can just push to the $SITE_BRANCH or make a PR to it to do all other updates

perlbuut's People

Contributors

mauke avatar shlomif avatar simcop2387 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

perlbuut's Issues

Add factoid delete command

The factoid delete command is almost the same as "forget" but lets things fall through to a parent namespace. An example:

Config

Namespaces:
    #perlbot - has parent namespace ##NULL
    ##NULL - default namespace

example conversation:

Joined #perlbot
<simcop2387> perlbot: foo
<perlbot> simcop2387: no factoid found.  did you mean [food]?
<simcop2387> perlbot: ##NULL learn foo is bar
<perlbot> simcop2387: Stored foo as bar
<simcop2387> perlbot: foo
<perlbot> simcop2387: bar
<simcop2387> perlbot: literal foo
<perlbot> simcop2387: <*:##NULL> foo is bar
<simcop2387> perlbot: foo is baz
<perlbot> simcop2387: Stored foo as baz
<simcop2387> perlbot: literal foo
<perlbot> simcop2387: foo is baz
<simcop2387> perlbot: forget foo
<perlbot> simcop2387: I forgot foo
<simcop2387> perlbot: foo
<perlbot> simcop2387: no factoid found.  did you mean [food]?
<simcop2387> perlbot: delete foo
<perlbot> simcop2387: foo has been deleted from this namespace
<simcop2387> perlbot: literal foo
<perlbot> simcop2387: <*:##NULL> foo is bar

Add a factoid command that dumps the lookup down the namespace tree

As part of the namespace and factoid update to Postgresql 12, I realized there's a nice command to implement once I finish the other features, use this query

WITH RECURSIVE factoid_lookup_order_inner (depth, namespace, server, alias_namespace, alias_server, parent_namespace, parent_server, recursive, gen_server, gen_namespace) AS (
  SELECT 0 AS depth, namespace, server, alias_namespace, alias_server, parent_namespace, parent_server, recursive, generated_server, generated_namespace
    FROM factoid_config 
    WHERE namespace = ? AND server = ?
  UNION ALL
  SELECT p.depth+1 AS depth, m.namespace, m.server, m.alias_namespace, m.alias_server, m.parent_namespace, m.parent_server, m.recursive, m.generated_server, m.generated_namespace 
    FROM factoid_config m 
    INNER JOIN factoid_lookup_order_inner p 
      ON m.namespace = p.parent_namespace AND m.server = p.parent_server AND p.recursive
),
factoid_lookup_order (depth, namespace, server, alias_namespace, alias_server, parent_namespace, parent_server, recursive, gen_server, gen_namespace) AS (
  SELECT * FROM factoid_lookup_order_inner
  UNION ALL
  SELECT 0, '', '', NULL, NULL, NULL, NULL, false, '', '' WHERE NOT EXISTS (table factoid_lookup_order_inner)
),
get_latest_factoid (depth, factoid_id, subject, copula, predicate, author, modified_time, compose_macro, protected, original_subject, deleted, server, namespace) AS (
      SELECT DISTINCT ON (lo.dept) lo.depth, factoid_id, subject, copula, predicate, author, modified_time, compose_macro, protected, original_subject, f.deleted, f.server, f.namespace
      FROM factoid f
      INNER JOIN factoid_lookup_order lo 
        ON f.generated_server = lo.gen_server
        AND f.generated_namespace = lo.gen_namespace
      WHERE original_subject = ?
      ORDER BY depth ASC, factoid_id DESC
)
SELECT * FROM get_latest_factoid ORDER BY depth ASC, factoid_id DESC;

to implement it, this gives you each lookup that would happen and lets you see each state it'd find at each depth.

Twitter plugin notes

need a --no_replies to make it capable of ignoring replies to people. for details
need a --search /.../ to make it capable of searching for keywords. Should be able to get it to go on a hashtag vs an account too.
need a --link ability to make it take a link to a tweet and read it out
need a --index N to get the Nth tweet (looking backwards from now).

Add revisions to the core plugin

Let people get what version of a core module was shipped with a perl version

i.e. allow: corelist -v v5.10.0 Data::Dumper

To give out the revision the module was at in that release.

Allow more regex deliminators for changes

Example below

12:02:11 < rindolf> perlbot: optimisation =~ s{http://[\w./]+}{http://xrl.us/bm2pgh}
12:02:11 < perlbot> rindolf: No factoid found. Did you mean one of these: [optimisation] [optimization] [optimization club] [optimizing club] [optional module]
12:02:35 < rindolf> perlbot: optimization =~ s{http://[\w./]+}{http://xrl.us/bm2pgh}
12:02:11 < perlbot> rindolf: No factoid found. Did you mean one of these: [optimisation] [optimization] [optimization club] [optimizing club] [optional module]

also support ! and | for extra clarity.

Add commands for manipulating factoid config live from the bot

It'd be nice if some commands for examining or manipulating the factoid config were present. Also use some of this for documentation.

Things like:

  • factoid_config set alias example.com:#namespace to freenode.net:#perlbot [--recurse]
    This sets the namespace alias for the channel #namespace on server example.com to refer to freenode.net:#perlbot
  • factoid_config tree example.com:#namespace
    This gives a list of how the factoids are resolved: example.com:#namespace -> parentserver:#parentchannel -> ... -> *:##NULL
  • factoid_config dump example.com:#namespace
    Give back a JSON encoded copy of the config for this channel
  • factoid_config set command_prefix !
  • factoid_config unset command_prefix
    Control the factoid command prefix, only used in #regex right now, for a default factoid handler running in the channel.
    This lets things like the following work:
<simcop2387> !rehelp

<perlbot> simcop2387: Please share a https://regex101.com/ link containing your regex and sample data, stay as long as possible, and we'll do our best to assist you ASAP.

weval and sweval for older perls

weval and sweval need warnings.pm to work, and that wasn't included in perls 5.5 and earlier.

Suggest using -w commandline switch or $^W=1 in those versions.

Merge nfacts plugin into factoids.pm

Remove the need for the namespaced factoids plugin and make it a part of the main factoid plugin. Make it configured by the etc/plugins.conf still.

Too hard to contribute

I wanted to submit some patches but am having trouble running the bot at all.

Make default plugins per channel

Right now i've hacked this into place by making a marshalling plugin to handle it but it should be done inside the plugin manager instead. This adds unneeded latency that does affect the bot's response.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.