scripts

various script and utils
git clone git://z3bra.org/scripts
Log | Files | Refs

commit 9bd552b94e380e424ea03608a66799895877e8cf
parent e84a45be3e6a6b1516fda31ef60d0e68bc87f887
Author: z3bra <willy@mailoo.org>
Date:   Thu May 22 16:14:19 +0200

Search on youtube and return the first links and titles

Diffstat:
ys | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/ys b/ys @@ -0,0 +1,11 @@ +#!/bin/sh + +query=$(echo $@ | tr ' ' '+') +url="http://www.youtube.com/results?search_query=${query}" +regex='s,^.*title="\([^"]*\)".*href="\(/watch[^"]*\)".*$,\1  http://youtube.com\2,p' + + +curl -s "$url" | sed -n "$regex" | sed 3q | while IFS='' read t l; do + + echo "$t - $l" +done