From 421d611ea1906387c3459ab3f9993ca6412f9f30 Mon Sep 17 00:00:00 2001 From: 7 <7@sevvie.ltd> Date: Thu, 31 Mar 2022 07:26:44 -0700 Subject: [PATCH] chore: init and add cowsay-fedi --- README.md | 14 ++++++++++++++ cli/cowsay-fedi.sh | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 README.md create mode 100755 cli/cowsay-fedi.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..825f38a --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# awesome-fedi + +a repository that was created on relatively neutral ground in the fedisphere +for the purpose of ensuring everyone has access to tiny little utility scripts +that make people's lives easier. It's of educational value, or something. + +I haven't decided if I will add an upstream on github yet. It would make things +easy for everyone, but it's also github. + +--- + +* [CLI Utilites](#cli-utilities) + +## CLI Utilities diff --git a/cli/cowsay-fedi.sh b/cli/cowsay-fedi.sh new file mode 100755 index 0000000..834f572 --- /dev/null +++ b/cli/cowsay-fedi.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +curl -s -X GET -H 'Accept: application/json' $1 | + perl -MJSON -MURI -E ' + my $json = decode_json(<>); + my $user_url = URI->new($json->{attributedTo}); + my $user = $user_url->path =~ s/\/users\///r; + say "$json->{source}\n -- \@$user\@${\$user_url->host}"' | + cowsay | + lolcat