Skip to content

Instantly share code, notes, and snippets.

@ekingery
Created July 2, 2019 15:54
Show Gist options
  • Save ekingery/327fd67066e5518e7500e8cc2f231ed5 to your computer and use it in GitHub Desktop.
Save ekingery/327fd67066e5518e7500e8cc2f231ed5 to your computer and use it in GitHub Desktop.
Single-User Tweekly
# sub last.fm $USER and $KEY, uses https://github.com/twitter/twurl
38 12 * * 0 /usr/local/bin/twurl -X POST -H api.twitter.com "/1.1/statuses/update.json?status=♬ This week's top spins on $USER Last FM `curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getWeeklyTrackChart&user=$USER&api_key=$KEY&format=json" | sed s='#'==g | sed s='@'==g | jq -r '[.weeklytrackchart.track[] | .attr.rank, .artist.text, .name]' | grep -v "\]" | grep -v "\[" | paste -d" " - - - | cut -b 3- | sed s#'"'##g | sed 's#,##g' | sed s#' '#'_'#g | head -5`" | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment