Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # coding: utf-8
- #####################################################################################################
- # How to use
- # ###################################################################################################
- #
- # python get_and_post.py
- # -> It will push the listens from lastfm to listenbrainz.
- # -> Successful working with resolve issues LB-68, LB-87, LB-88 and may be more.
- #####################################################################################################
- from lastplayed import *
- from post_listen import *
- import pylast
- # not needed
- import string
- import random
- import time
- USERNAME = 'armalcolite'
- #r = get_recent_tracks(USERNAME)
- #r = get_organised_list(r)
- #print(r)
- #for i in r:
- # post_single(i[0].encode('utf-8'), i[1].encode('utf-8'), i[2].encode('utf-8'))
- def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
- return ''.join(random.choice(chars) for _ in range(size))
- for i in range(50):
- A = id_generator()
- B = id_generator()
- C = int(time.time())
- C += int(random.random()*100)
- print A,B,C
- post_single(A,B,C)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement