jcsalterego / constantine Goto Github PK
View Code? Open in Web Editor NEWConstantine helps you find your posts in the Hellthread.
License: Other
Constantine helps you find your posts in the Hellthread.
License: Other
Only keep posts before a certain date
Original request: https://bsky.app/profile/eviealways.com/post/3jz4d3ktems2x
I succesfully setup a local copy of Constantine in WSL2 and was able to use get_helltheads.py
just fine but when i call delete_hellthreads.py stublad.renoproject.org
, it attempts to delete a post and then dies.
I'm using WSL2 and Python 3.10.6.
Here's the output:
Stu@StuLaptop:~/Constantine$ ./delete_hellthreads.py stublad.renoproject.org
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
cursor = <scrubbed>
1135 posts total
80 hellthread posts total
Deleting https://bsky.app/profile/<scrubbed>
Traceback (most recent call last):
File "/home/Stu/.local/lib/python3.10/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/Stu/Constantine/./delete_hellthreads.py", line 142, in <module>
main()
File "/home/Stu/Constantine/./delete_hellthreads.py", line 128, in main
results = delete_post(session, uri)
File "/home/Stu/Constantine/./delete_hellthreads.py", line 95, in delete_post
return post_xrpc(session, "com.atproto.repo.deleteRecord", json=json)
File "/home/Stu/Constantine/constantine.py", line 58, in post_xrpc
return response.json()
File "/home/Stu/.local/lib/python3.10/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)```
When parsing the date of a post for filtering (link), datetime.fromisoformat
is used. In versions of Python before 3.11, the timestamps returned from the Bluesky API cannot be parsed. This change is mentioned in the datetime docs
Python 3.10 running on ubuntu:
>>> datetime.fromisoformat("2023-07-03T20:34:46.264Z")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Invalid isoformat string: '2023-07-03T20:34:46.264Z'
Python 3.11 running on the same instance:
>>> datetime.fromisoformat("2023-07-03T20:34:46.264Z")
datetime.datetime(2023, 7, 3, 20, 34, 46, 264000, tzinfo=datetime.timezone.utc)
Updating the workflow files to explicitly use 3.11 fixes this. Alternatively, a different datetime parsing method could be used to support older versions of Python.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.