2 KiB
2 KiB
Things to think about do
Debates
- Hating the name
jobsandrun_job. Requests is an existing package dependency though.tasksseems to broard. I'm sure there's probably an already existing name that I can't articulate how to find.apirequests,rqsts,apicalls? - Should these
jobbe called with dot notation? Or with slashes? Or something else? Is it okay to have these as strings? - Should we do validation in the
jobsor let the server do that all? wrappedis an awkward name. What's more proper? But also obvious?- Should have consistent format, ie
create_{noun}, anddelete_{noun}, rather than just verbing iecomment,postas this is ambiguousetc - Known/displayed entity names or as-is/DB names, ie:
trustorreltrust? We call trust as reltrust in the database and in the backend, relfollow for follow, but don't have relblock, instead it's userblock. It's a bit inconsistent and not very obvious at all.
Feels helpful to make it more obvious inside the wrapper but is also potentially misleading.
ToDo:
- Make more jobs
- Make more wrappers
- Write more documentation
- Wrappers should also accept actual keys for when you know them
- Use this:
try:
# NOTE: Maybe define self.session = requests.Session() in an __init__ or similar and use it here instead of the 'with' block for better performance.
# Session for connection pooling and performance improvement
with requests.Session() as session:
# Update session headers once instead of every request
session.headers.update(headers)
# GET requests to fetch normal and removed posts
res_n = session.get(url_normal, timeout=60)
# res_r = session.get(url_removed, timeout=60)
# Checking if both requests are good before proceeding
res_n.raise_for_status()
# res_r.raise_for_status()
Trust Follow Mute Block
Remvoved posts