Created
April 14, 2017 18:03
-
-
Save meoyawn/f5dbcc7cf15fefdf662afccfbbac7800 to your computer and use it in GitHub Desktop.
love last.fm nowplaying from CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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