so://phie

verbal

A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal

blob: 6e047a8575c4f882c85c6df17e430d9c7746bc42 (354 bytes)[doc][blame][raw]

1#!/bin/bash

2

3id="$1"

4echo "$id"

5ext="$2"

6url=$(psql verbal -c "select icon from station where id = $id;" -t | xargs echo -n)

7curl -sL "$url" -o "logo.$ext"

8color=$(echo $(convert "logo.$ext" -colors 1 -unique-colors txt:) | awk '{print substr($8, 0, 7)}')

9echo "$color"

10psql verbal -c "update station set color = '$color' where id = $id;"

11rm "logo.$ext"