Add script for reviewing previous years’ activities
This commit is contained in:
parent
3d283da0f7
commit
e6043132f8
2 changed files with 28 additions and 5 deletions
19
otd.py
Normal file
19
otd.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import datetime,os
|
||||
|
||||
year = int(datetime.datetime.strftime(datetime.datetime.today(),"%Y"))
|
||||
monthstring = datetime.datetime.strftime(datetime.datetime.today(),"%m")
|
||||
datestring = datetime.datetime.strftime(datetime.datetime.today(),"%d")
|
||||
|
||||
fileplace = "/home/mdd/Documents/drive/org/journal/"
|
||||
|
||||
thisyear = year
|
||||
|
||||
while year > 1993:
|
||||
year -= 1
|
||||
target = fileplace + str(year) + "/" + monthstring + "/" + str(year) + "-" + monthstring + "-" + datestring + ".org"
|
||||
if os.path.exists(target):
|
||||
if year < thisyear -1:
|
||||
print("Press enter to continue")
|
||||
input()
|
||||
print(open(target,"r").read())
|
||||
|
14
scrobble.py
14
scrobble.py
|
@ -8,9 +8,9 @@ thealbums = sorted(albums.albums,key=lambda d: d["name"])
|
|||
|
||||
def countdown(t): # https://stackoverflow.com/a/25189629
|
||||
while t:
|
||||
mins, secs = divmod(t, 60)
|
||||
timeformat = '{:02d}:{:02d}'.format(mins, secs)
|
||||
print(timeformat, end='\r')
|
||||
mins, secs = divmod(t,60)
|
||||
timeformat = '{:02d}:{:02d}'.format(mins,secs)
|
||||
print("> " + timeformat,end='\r')
|
||||
time.sleep(1)
|
||||
t -= 1
|
||||
|
||||
|
@ -30,8 +30,12 @@ def scrobble(thealbum):
|
|||
if theartist == "noscrob":
|
||||
print("Skipped " + thetrack)
|
||||
else:
|
||||
last_api_call = network.scrobble(theartist,thetrack,int(time.time()))
|
||||
print("Scrobbled " + item)
|
||||
if tracklist[item] > 29:
|
||||
last_api_call = network.scrobble(theartist,thetrack,int(time.time()))
|
||||
print("Scrobbled " + thetrack)
|
||||
else:
|
||||
print("Skipped " + thetrack)
|
||||
last_api_call = network.update_now_playing(theartist,thetrack,duration=tracklist[item])
|
||||
countdown(tracklist[item])
|
||||
if i < len(album["tracks"]):
|
||||
input("Press enter after changing side")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue