l 5 acronym: refactor code
This commit is contained in:
parent
9717e5a2e0
commit
2e87439340
@ -1,13 +1,16 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
pkgs.writeScriptBin "acronym" ''
|
pkgs.writeScriptBin "acronym" ''
|
||||||
|
|
||||||
#! ${pkgs.bash}/bin/bash
|
#! ${pkgs.bash}/bin/bash
|
||||||
|
|
||||||
acro=$1
|
acro=$1
|
||||||
|
|
||||||
curl -s http://www.acronymfinder.com/$acro.html \
|
curl -s http://www.acronymfinder.com/$acro.html \
|
||||||
| grep 'class="result-list__body__rank"' \
|
| grep 'class="result-list__body__rank"' \
|
||||||
| sed 's/.*title="\([^"]*\)".*/\1/' \
|
| sed '
|
||||||
| sed 's/^.* - //' \
|
s/.*title="\([^"]*\)".*/\1/
|
||||||
| sed "s/'/'/g"
|
s/^.* - //
|
||||||
|
s/'/'\'''/g
|
||||||
|
'
|
||||||
''
|
''
|
||||||
|
Loading…
Reference in New Issue
Block a user