chore: init and add cowsay-fedi

This commit is contained in:
7 2022-03-31 07:26:44 -07:00
commit 421d611ea1
2 changed files with 24 additions and 0 deletions

14
README.md Normal file
View File

@ -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

10
cli/cowsay-fedi.sh Executable file
View File

@ -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