Categories:
-
3d 96 articles
-
animations 16 articles
-
architecture 47 articles
-
blender 98 articles
-
bédé 19 articles
-
techdrawing 24 articles
-
freecad 188 articles
-
gaming 1 articles
-
idsampa 8 articles
-
inthepress 8 articles
-
linux 57 articles
-
music 1 articles
-
nativeifc 29 articles
-
opensource 265 articles
-
orange 4 articles
-
photo 16 articles
-
projects 35 articles
-
receitas 176 articles
-
saopaulo 18 articles
-
sketches 162 articles
-
talks 25 articles
-
techdrawing 24 articles
-
textes 7 articles
-
trilhas 3 articles
-
urbanoids 1 articles
-
video 47 articles
-
webdesign 7 articles
-
works 151 articles
Archives:
-
2007 22 articles
-
2008 32 articles
-
2009 66 articles
-
2010 74 articles
-
2011 74 articles
-
2012 47 articles
-
2013 31 articles
-
2014 38 articles
-
2015 28 articles
-
2016 36 articles
-
2017 41 articles
-
2018 46 articles
-
2019 59 articles
-
2020 18 articles
-
2021 20 articles
-
2022 7 articles
-
2023 25 articles
-
2024 12 articles
IMDB watchlist to todo.txt
I'm a big fan of todo.txt. It's a super simple format for tasklists, basically one line per task, start with x
to mark a task as done, use (A), (B), (C)
... to give a priority, use @Something
to add tags, due:2021-10-18
to indicate a due date, etc. Everything is saved into one simple text file (named todo.txt, as you might have guessed).
I have it show the most urgent task on my desktop's task bar, synchronize with my phone through nextcloud, integrate in my calendar (using simpletask). The possibilities are endless. I also use it to keep lists of movies I want to watch. But I also use IMDB for that, so here is a little script that fetches my IMDB watchlist and updates the entries in my todo list with it. Enjoy!
#!/usr/bin/python
from urllib import request
import re
import json
# fetch the watchlist
r = request.urlopen("https://www.imdb.com/user/ur118635647/watchlist")
b = r.read().decode("utf8")
# fortunately for us, everything is stored as a big json string there!!
j = re.findall("IMDbReactInitialState\.push\((.*?)\)\;", b)[0]
d = json.loads(j)
t = d["titles"]
# build a list of movies
movies = {}
for k, v in t.items():
m = v["primary"]
tt = m["title"]
tr = str(v["ratings"]["rating"])
tu = "https://www.imdb.com"+m["href"]
ty = v["type"]
if ty == "featureFilm":
ty = "movie"
tp = v["plot"]
# build the todo.txt entry
s = " - ".join([tt, ty, tr, tu, tp]) + " @Watchlist"
# print(s)
movies[tt] = s
# read existing todo.txt file
todos = []
with open("/home/yorik/.todo/todo.txt") as f:
for rl in f:
todos.append(rl.strip())
# check if movie is there already
for i in range(len(todos)):
todo = todos[i]
if "@Watchlist" in todo:
found = None
for key in movies.keys():
if todo.lower().startswith(key.lower()):
if todo != movies[key]:
todos[i] = movies[key]
found = key
break
if found:
del movies[found]
found = None
# add all the remaining movies
for k in movies.keys():
todos.append(movies[k])
# write the file
with open("/home/yorik/.todo/todo.txt", "w") as f:
f.write("\n".join(todos))
Read next:
FreeCAD BIM development news - September 2021 - The big 2D upgrade:
Series of new tools to ease the creation of 2D documents from BIM models
Comment on this post on Twitter