l 5: add urban
This commit is contained in:
parent
f0863085c7
commit
5509ed2263
@ -10,6 +10,7 @@
|
|||||||
};
|
};
|
||||||
mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {};
|
mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {};
|
||||||
mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {};
|
mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {};
|
||||||
|
urban = pkgs.callPackage ./urban/default.nix {};
|
||||||
xmonad-lass =
|
xmonad-lass =
|
||||||
let src = pkgs.writeNixFromCabal "xmonad-lass.nix" ./xmonad-lass; in
|
let src = pkgs.writeNixFromCabal "xmonad-lass.nix" ./xmonad-lass; in
|
||||||
pkgs.haskellPackages.callPackage src {};
|
pkgs.haskellPackages.callPackage src {};
|
||||||
|
21
lass/5pkgs/urban/default.nix
Normal file
21
lass/5pkgs/urban/default.nix
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
pkgs.writeScriptBin "urban" ''
|
||||||
|
#!/bin/sh
|
||||||
|
set -euf
|
||||||
|
term=$1
|
||||||
|
curl -LsS 'http://www.urbandictionary.com/define.php?term='"$term" \
|
||||||
|
| sed 's/<\/\?a\>[^>]*>//g' \
|
||||||
|
| sed 's/<\([^>]*\)>/\n<\1\n/g' \
|
||||||
|
| grep . \
|
||||||
|
| sed -n '/<div class=.meaning./,/<\/div/p' \
|
||||||
|
| sed 's/<div class=.meaning./-----/' \
|
||||||
|
| grep -v '^</div\>' \
|
||||||
|
| grep -v '^<br\>' \
|
||||||
|
| sed '
|
||||||
|
s/"/"/g
|
||||||
|
s/'/'\'''/g
|
||||||
|
s/>/>/g
|
||||||
|
s/</>/g
|
||||||
|
'
|
||||||
|
''
|
Loading…
Reference in New Issue
Block a user