diff --git a/api/index.php b/api/index.php index 44abc67..1f3ed62 100644 --- a/api/index.php +++ b/api/index.php @@ -1,40 +1,34 @@ = count($tags) ? array_rand($tags) : intval($_GET["key"])]; + $tags = file("../taglines.txt"); + $i = intval($_GET["key"]); + echo $tags[$i >= count($tags) ? array_rand($tags) : $i]; } elseif (isset($_GET["fonts"])) { // get list of fonts + $fonts = __DIR__."/fonts/"; echo json_encode(array_map(function ($f) { return basename($f, ".flf"); }, glob("$fonts*.flf"))); } elseif (isset($_GET["text"])) { // run figlet + $fonts = __DIR__."/fonts/"; echo shell_exec( - "/usr/bin/figlet -d $fonts -w 120 -f " . - escapeshellarg($_GET["font"] ?? "standard") . " " . + "/usr/bin/figlet -d $fonts -w 80 -f " . + escapeshellarg($_GET["font"] ?? "standard") . " -- " . escapeshellarg($_GET["text"]) ); } -elseif (isset($_GET["users"])) { - $users = []; - foreach (scandir("/home") as $user) { - if (!is_dir("/home/$user/public_html")) continue; - $users[] = $user; - } - // usort($users, function($a, $b) { return filemtime($a) - filemtime($b); } ); - echo json_encode($users); -} - else { // get a random tagline + $tags = file("../taglines.txt"); echo $tags[array_rand($tags)]; } + diff --git a/blog/weechat-setup.html b/blog/weechat-setup.html index f65e0ff..b040876 100644 --- a/blog/weechat-setup.html +++ b/blog/weechat-setup.html @@ -72,12 +72,6 @@ weechat setup
/grep
plugins include the likes of weechat-slack and the irc plugin.
- -unless you need slack support, you should be ok without additional plugins
-you can find the rest of my configs here.
diff --git a/blog/weechat-setup.md b/blog/weechat-setup.md index 73a5e6f..da2fd16 100644 --- a/blog/weechat-setup.md +++ b/blog/weechat-setup.md @@ -36,13 +36,6 @@ these scripts can be managed with the built in `/script` tool. press i, then ent * [grep.py](https://weechat.org/scripts/source/grep.py.html/) - quickly search history and buffers with `/grep` -### plugins - -plugins include the likes of [weechat-slack](https://github.com/wee-slack/wee-slack) and the irc plugin. - -unless you need slack support, you should be ok without additional plugins - - ### the rest of my configs you can find the rest of my configs [here](https://tildegit.org/ben/dotfiles/src/branch/master/weechat/.weechat). diff --git a/index.php b/index.php index d12fc61..3b99af5 100644 --- a/index.php +++ b/index.php @@ -21,12 +21,6 @@ - - @@ -36,11 +30,8 @@{{ tagline }} - -
+ +=$taglines[array_rand($taglines)]?>