diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-09-05 10:02:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-05 10:02:32 -0400 |
commit | 41e47bed9d92f3baf913689bec216e4229b97dbd (patch) | |
tree | f350fb540024008d7e74cfd294ce138b717aa036 | |
parent | 0d33589a9c457cd0c448817d3f21abd5a4125ec5 (diff) | |
download | yandere-41e47bed9d92f3baf913689bec216e4229b97dbd.tar.gz yandere-41e47bed9d92f3baf913689bec216e4229b97dbd.tar.bz2 yandere-41e47bed9d92f3baf913689bec216e4229b97dbd.zip |
Create README.md
-rw-r--r-- | README.md | 80 |
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 | ||
2 | Simple 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 | |||
4 | It 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 | |||
6 | Examples of `yandere` bots: | ||
7 | |||
8 | - [@bbbbbbbbbbbaka](https://twitter.com/bbbbbbbbbbbaka) (d-su), which posts inside jokes that no one understands | ||
9 | |||
10 | ## Syntax | ||
11 | |||
12 | The 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 | ``` | ||
14 | MAIN | ||
15 | Here's an option. | ||
16 | This is another one. | ||
17 | Guess what! | ||
18 | |||
19 | SECOND_GROUP | ||
20 | This group only has two options. | ||
21 | Here's the other one. | ||
22 | ``` | ||
23 | |||
24 | A 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 | ``` | ||
26 | MAIN | ||
27 | {SECOND_GROUP} | ||
28 | {SECOND_GROUP} {SECOND_GROUP} | ||
29 | |||
30 | SECOND_GROUP | ||
31 | foo | ||
32 | bar | ||
33 | ``` | ||
34 | |||
35 | The datafile above can generate the following outputs: | ||
36 | ``` | ||
37 | foo | ||
38 | bar | ||
39 | foo foo | ||
40 | foo bar | ||
41 | bar foo | ||
42 | bar bar | ||
43 | ``` | ||
44 | |||
45 | This 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 | ``` | ||
47 | MAIN | ||
48 | foo | ||
49 | foo {MAIN} | ||
50 | ``` | ||
51 | |||
52 | The datafile above can generate `foo`, `foo foo`, `foo foo foo`, and so on. | ||
53 | |||
54 | Transclusions 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 | |||
56 | Transclusions 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 | ``` | ||
58 | MAIN | ||
59 | {VAR=SECOND_GROUP} {VAR} | ||
60 | |||
61 | SECOND_GROUP | ||
62 | foo | ||
63 | ``` | ||
64 | |||
65 | The datafile above would generate the text `foo foo`. | ||
66 | |||
67 | Finally, 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 | ``` | ||
69 | MAIN | ||
70 | {SECOND_GROUP} | ||
71 | {second_group} | ||
72 | {Second_group} | ||
73 | |||
74 | SECOND_GROUP | ||
75 | FOO BAR | ||
76 | ``` | ||
77 | |||
78 | The datafile above can generate either `FOO BAR`, `foo bar`, or `Foo Bar`. | ||
79 | |||
80 | There is one "special" group name: `{\n}` is always replaced by a newline. | ||