Added sndcrd.com integration
This commit is contained in:
parent
05493e2597
commit
9ef5bb5c73
1 changed files with 15 additions and 5 deletions
|
@ -1,5 +1,15 @@
|
||||||
#!/usr/bin/env ruby
|
#!/bin/bash
|
||||||
file="~/.gitshots/#{Time.now.to_i}.jpg"
|
|
||||||
puts "Say Cheese!!~! ;)"
|
# Grabs the project, kind of specific to github's format username/project
|
||||||
system "imagesnap -q #{file}"
|
PROJECT=`git remote -v | head -1 | sed 's/.*git@.*:\(.*\).git.*/\1/'`
|
||||||
exit 0
|
|
||||||
|
# Get artist from Spotify
|
||||||
|
ARTIST=`osascript -e 'tell application "Spotify" to artist of current track'`
|
||||||
|
|
||||||
|
# Get track from Spotify
|
||||||
|
TRACK=`osascript -e 'tell application "Spotify" to name of current track'`
|
||||||
|
|
||||||
|
# Make it so!
|
||||||
|
curl "http://sndcrd.com/api?key=${SNDCRD_KEY}&project=${PROJECT}&artist=${ARTIST}&track=${TRACK}" > /dev/null 2>&1
|
||||||
|
|
||||||
|
imagesnap -q ~/.gitshots/`date +%s`.jpg &
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue