Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # coding: utf-8
  3.  
  4. #####################################################################################################
  5. # How to use
  6. # ###################################################################################################
  7. #
  8. # python get_and_post.py
  9. # -> It will push the listens from lastfm to listenbrainz.
  10. # -> Successful working with resolve issues LB-68, LB-87, LB-88 and may be more.
  11. #####################################################################################################
  12.  
  13. from lastplayed import *
  14. from post_listen import *
  15. import pylast
  16.  
  17. # not needed
  18. import string
  19. import random
  20. import time
  21.  
  22.  
  23. USERNAME = 'armalcolite'
  24.  
  25. #r = get_recent_tracks(USERNAME)
  26. #r = get_organised_list(r)
  27.  
  28. #print(r)
  29. #for i in r:
  30. # post_single(i[0].encode('utf-8'), i[1].encode('utf-8'), i[2].encode('utf-8'))
  31.  
  32.  
  33. def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
  34. return ''.join(random.choice(chars) for _ in range(size))
  35.  
  36. for i in range(50):
  37. A = id_generator()
  38. B = id_generator()
  39. C = int(time.time())
  40. C += int(random.random()*100)
  41.  
  42. print A,B,C
  43. post_single(A,B,C)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement