about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--README.md80
1 files changed, 80 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..75acbdf --- /dev/null +++ b/README.md
@@ -0,0 +1,80 @@
1# yandere
2Simple text substitution Twitter bot in the vein of [chemist](https://github.com/hatkirby/chemist), but without the dependency on [verbly](https://github.com/hatkirby/verbly). Tweets every hour, generating text based off of a data file constructed with a simple syntax.
3
4It uses my Twitter library [libtwitter++](https://github.com/hatkirby/libtwittercpp) to post to Twitter, and [YAMLcpp](https://github.com/jbeder/yaml-cpp) to read a configuration file.
5
6Examples of `yandere` bots:
7
8- [@bbbbbbbbbbbaka](https://twitter.com/bbbbbbbbbbbaka) (d-su), which posts inside jokes that no one understands
9
10## Syntax
11
12The data file is split up into "groups", which are lists of options. The start of a group is denoted by its name in all caps, followed immediately by a line-seperated list of options. Each group must be separated by at least one empty line. Example:
13```
14MAIN
15Here's an option.
16This is another one.
17Guess what!
18
19SECOND_GROUP
20This group only has two options.
21Here's the other one.
22```
23
24A group can be mentioned within an option using the syntax `{GROUP}`. This is called transclusion. When the bot would generate text including a transclusion, it replaces it with a uniformly-at-random picked option from that group. Example:
25```
26MAIN
27{SECOND_GROUP}
28{SECOND_GROUP} {SECOND_GROUP}
29
30SECOND_GROUP
31foo
32bar
33```
34
35The datafile above can generate the following outputs:
36```
37foo
38bar
39foo foo
40foo bar
41bar foo
42bar bar
43```
44
45This is the primary way in which the bot generates tweets; it begins with the text `{MAIN}` and transcludes recursively until there are no remaining transclusions. Example:
46```
47MAIN
48foo
49foo {MAIN}
50```
51
52The datafile above can generate `foo`, `foo foo`, `foo foo foo`, and so on.
53
54Transclusions support a few basic modifiers, which are denoted with the syntax `{GROUP:modifier}`. Currently, the only modifier is `indefinite`, which places either "an" in front of the transcluded text if it is all caps or begins with a vowel, and places "a" otherwise.
55
56Transclusions can also be stored in variables so that they can be reused. This is denoted with the syntax `{VAR=GROUP}`. When the bot encounters this transclusion, it generates a replacement as it would for `{GROUP}`, and then essentially creates an imaginary new group called `VAR` into which it places the generated replacement. That group can later be transcluded from using `{VAR}` as per usual. Example:
57```
58MAIN
59{VAR=SECOND_GROUP} {VAR}
60
61SECOND_GROUP
62foo
63```
64
65The datafile above would generate the text `foo foo`.
66
67Finally, you can modify the capitalization of a transclusion by changing the casing of the group's name. Referencing a group in all caps transcludes text as normal, referencing it in all lowercase lowercases the generated text, and referencing it with the first letter uppercase and the second letter lowercase will title case the generated text (specifically, it will capitalize the first letter of each generated word). Example:
68```
69MAIN
70{SECOND_GROUP}
71{second_group}
72{Second_group}
73
74SECOND_GROUP
75FOO BAR
76```
77
78The datafile above can generate either `FOO BAR`, `foo bar`, or `Foo Bar`.
79
80There is one "special" group name: `{\n}` is always replaced by a newline.