Instantly share code, notes, and snippets.

Embed
What would you like to do?
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