Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
"""
usage
python scroble.py <artist> <song> <timestamp>
"""
import sys
import time
import pylast
API_KEY = "api-key";
API_SECRET = "api-secret"
USERNAME = "lastfm-username"
PASSWORD = "lastfm-password"
def main():
artist = sys.argv[1]
title = sys.argv[2]
song_started = sys.argv[3]
network = pylast.LastFMNetwork(api_key = API_KEY, api_secret = API_SECRET, username = USERNAME, password_hash = pylast.md5(PASSWORD))
network.scrobble(artist = artist, title = title, timestamp = song_started)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.