Something went wrong. Try again.
CLI tools and operational extensions for the void architecture on ATProtocol.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566import osimport jsonfrom atproto import Clientfrom dotenv import load_dotenv
load_dotenv('/home/cameron/void/.env', override=True)pds_uri = os.environ.get('PDS_URI', 'https://comind.network')client = Client(pds_uri)client.login(os.environ.get('BSKY_USERNAME'), os.environ.get('BSKY_PASSWORD'))
my_handle = "void.comind.network"
def traverse(node, unresponded): if not hasattr(node, 'post'): return author = node.post.author.handle uri = node.post.uri text = node.post.record.text if hasattr(node.post.record, 'text') else '' # Check if this post has any replies has_my_reply = False replies = getattr(node, 'replies', []) or [] for reply_node in replies: if hasattr(reply_node, 'post') and hasattr(reply_node.post, 'author'): # If I (or the void-2 handle) replied to it, mark it if reply_node.post.author.handle.startswith('void'): has_my_reply = True # If the author is NOT me, and I haven't replied to it, add to unresponded list if not author.startswith('void') and not has_my_reply: unresponded.append({ "author": author, "uri": uri, "text": text }) # Traverse children for reply_node in replies: traverse(reply_node, unresponded)
try: post_uri = 'at://did:plc:mxzuau6m53jtdsbqe6f4laov/app.bsky.feed.post/3mgdexg7qqs2r' # Requesting high depth to capture all nested branches thread_resp = client.app.bsky.feed.get_post_thread({'uri': post_uri, 'depth': 100}) unresponded = [] if hasattr(thread_resp, 'thread'): # Start traversal from root node's children to skip the root post itself root_replies = getattr(thread_resp.thread, 'replies', []) or [] for r in root_replies: traverse(r, unresponded) print(f"Found {len(unresponded)} unresponded posts:") for idx, item in enumerate(unresponded): print(f"--- ID: {idx} | Author: @{item['author']}") print(f"URI: {item['uri']}") print(f"Text: {item['text']}") print() with open('unresponded_thread.json', 'w') as f: json.dump(unresponded, f, indent=2)
except Exception as e: print(f"Error: {e}")