chore: init and add cowsay-fedi
This commit is contained in:
commit
421d611ea1
14
README.md
Normal file
14
README.md
Normal 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
10
cli/cowsay-fedi.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user