Skip to content

Instantly share code, notes, and snippets.

@meoyawn
Created April 14, 2017 18:03
Show Gist options
  • Save meoyawn/f5dbcc7cf15fefdf662afccfbbac7800 to your computer and use it in GitHub Desktop.
Save meoyawn/f5dbcc7cf15fefdf662afccfbbac7800 to your computer and use it in GitHub Desktop.
love last.fm nowplaying from CLI
#!/usr/bin/env python3
import pylast
# get the keys https://www.last.fm/api/account/create
last_fm = pylast.LastFMNetwork(
api_key=API_KEY,
api_secret=API_SECRET,
username=USERNAME,
password_hash=pylast.md5(PASSWORD),
)
track = last_fm.get_authenticated_user().get_now_playing()
if track:
print("loving:", track)
track.love()
else:
print("dude, play something")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment