a digital entity named phi that roams bsky phi.zzstoatzz.io
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

include post URLs in feed output so phi can link to things

_format_feed_posts now shows the bsky.app URL for each post.
phi couldn't link to timeline content because feed output only
showed handle + text — no URI. now it has the URL to include
when riffing on someone's post.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+9 -1
+9 -1
src/bot/tools/_helpers.py
··· 73 73 return f"{years}y ago" 74 74 75 75 76 + def _post_url(uri: str, handle: str) -> str: 77 + """Convert an AT-URI to a bsky.app URL.""" 78 + # at://did:plc:.../app.bsky.feed.post/rkey -> https://bsky.app/profile/handle/post/rkey 79 + rkey = uri.split("/")[-1] if "/" in uri else "" 80 + return f"https://bsky.app/profile/{handle}/post/{rkey}" if rkey else "" 81 + 82 + 76 83 def _format_feed_posts(feed_posts, limit: int = 20) -> str: 77 84 """Format feed posts into a readable summary.""" 78 85 today = date.today() ··· 82 89 text = post.record.text if hasattr(post.record, "text") else "" 83 90 handle = post.author.handle 84 91 likes = post.like_count or 0 92 + url = _post_url(post.uri, handle) 85 93 age = ( 86 94 _relative_age(post.indexed_at, today) 87 95 if hasattr(post, "indexed_at") and post.indexed_at 88 96 else "" 89 97 ) 90 98 age_str = f", {age}" if age else "" 91 - lines.append(f"@{handle} ({likes} likes{age_str}): {text[:200]}") 99 + lines.append(f"@{handle} ({likes} likes{age_str}): {text[:200]}\n {url}") 92 100 return "\n\n".join(lines) 93 101 94 102