From 6600b20c6bc5446242a9d5fbe93873ffac9e0a45 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 20 May 2015 17:27:20 +0200 Subject: add timemachine --- timemachine/bin/youtube_boring | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 timemachine/bin/youtube_boring (limited to 'timemachine/bin/youtube_boring') diff --git a/timemachine/bin/youtube_boring b/timemachine/bin/youtube_boring new file mode 100755 index 00000000..6d799a10 --- /dev/null +++ b/timemachine/bin/youtube_boring @@ -0,0 +1,26 @@ +#!/bin/sh +set -euf + +main() { + if [ ! $# -eq 0 ]; then + usage + fi + + get_petite_video +} + +get_petite_video() { + video='' + until [ ! $video = '' ]; do + video=$(curl -sS -L http://www.petittube.com/ | sed -n 's|.*http://www.youtube\.com\/v\/\([^?]*\).*|http://youtube.com/watch?v=\1|p') + done + echo $video +} + +usage() { + echo 'returns the url to a boring youtube video' + echo 'scrapes http://www.petittube.com/' + echo 'example: mpv $(youtube_unseen)' +} + +main -- cgit v1.2.3