Wrappers accept item_key where possible

More tests
This commit is contained in:
simonwt 2026-04-16 21:31:32 +01:00
parent 7db5a29081
commit 0bcec8163c
12 changed files with 140 additions and 31 deletions

View file

@ -26,24 +26,6 @@ potentially misleading.
2. Make more wrappers
3. Write more documentation
4. Wrappers should also accept actual keys for when you know them
5. Use this:
```python
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