Skip to content

Instantly share code, notes, and snippets.

@Kagee
Created September 9, 2015 11:39
Show Gist options
  • Save Kagee/03aef92f54dda7e88891 to your computer and use it in GitHub Desktop.
Save Kagee/03aef92f54dda7e88891 to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
# Test:
# ./scrape.sh "https://summit.debconf.org/debconf15/meeting/286/continuous-delivery-of-debian-packages/"
# ./scrape.sh "https://summit.debconf.org/debconf15/meeting/329/debians-central-role-future-software-freedom/"
#./scrape.sh "https://summit.debconf.org/debconf15/meeting/331/what-is-to-be-done/"
PAGE=$(wget -q -O - $1)
TITLE=$(echo "$PAGE" | perl -ne 'print $1,"\n" if /<h2>(.*)--/' | recode HTML_4.0..utf-8)
DATE=$(echo "$PAGE" | perl -ne 'print $1,"\n" if /<h3>(\d\d\d\d-\d\d-\d\d)/')
SPEAKER=$(echo "$PAGE" | perl -ne 'print $1,"\n" if /<h2>.*--\s*(.*)<\/h2>/' | recode HTML_4.0..utf-8)
URL=$(echo "$PAGE" | perl -ne 'print $1,"\n" if /href="(.*)">Video of/')
echo "Title: $TITLE"
echo "Speaker: $SPEAKER"
echo "Date: $DATE"
echo "URL: $URL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment