Created
January 17, 2016 16:39
-
-
Save jackdpage/7b23471317277dfaba37 to your computer and use it in GitHub Desktop.
Generates CSV files of Rosco gel colours from the Rosco website
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $1 = 'ECOLOUR' ]; then | |
wget http://rosco.com/filters/ecolour.cfm -O - | grep '\(id="colorSwatch"\)\|\(<b>E-Colour\)\|\(<img src="../mycolor\)' | sed 's/.*\(#[a-f0-9]\{6\}\).*/\U\1\E,/;s/<\/b>//;s/.*\(#[0-9]\+\): \(.*\)/\1,\2,,/;s/.*mycolor.*/#FFFFFF,/' | tr -d '\n' | sed 's/,\{2\}/\n/g' | |
elif [ $1 = 'SUPERGEL' ]; then | |
wget http://rosco.com/filters/supergel.cfm -O - | grep '\(id="colorSwatch"\)\|\(<strong>Supergel\)\|\(<img src="../mycolor\)' | sed 's/.*\(#[a-f0-9]\{6\}\).*/\U\1\E,/;s/<\/strong>//;s/.*\(#[0-9]\+\): \(.*\)/\1,\2,,/;s/.*mycolor.*/#FFFFFF,/' | tr -d '\n' | sed 's/,\{2\}/\n/g' | |
else | |
echo 'You need to specify a type of gel, ECOLOUR or SUPERGEL.' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment