CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 09:02:30 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"aafae3473af165c852dff2f3eadfcfe9"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=Lc5C4eORTq8QRHsGlziY9TxQl8elgaHOciDQgLH9cIF6BV7U96XLxRS%2FufBCSlhccaJluHvfkEjZmvZ2nJrn7B4CeB%2FDzaeOKCYIM%2FrmX9ztd%2BI91BvR6AFqZoGW6Ouz671eEVIK%2BmgabrF7WrDcw5FxGrrg8tYERDkuCvd2P3GjG4%2Bx55hwyMnq%2BMDGWP542sevAu1iuzFZ9kZojFGbCQTisTLYjrvceLQFBk8qfZLUdZEqkplQ8mZamfFOiGVrEHiey6898yG14Kclj85cjg%3D%3D--IlXBX6on9GfBJJQi--CX1fwj6YdLDRGGec%2BtPgwA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.761861708.1760173350; Path=/; Domain=github.com; Expires=Sun, 11 Oct 2026 09:02:30 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 11 Oct 2026 09:02:30 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 9A44:3FDFA5:4F43CF:6B6DC7:68EA1D26
Run like this: uv run https://gist.githubusercontent.com/simonw/848a3b91169a789bc084a459aa7ecf83/raw/397ad07c8be0601eaf272d9d5ab7675c7fd3c0cf/follow_theirs.py · GitHub
Show Gist options
Save simonw/848a3b91169a789bc084a459aa7ecf83 to your computer and use it in GitHub Desktop.
{{ message }}
Instantly share code, notes, and snippets.
-
Star
9
(9)
You must be signed in to star a gist -
Fork
3
(3)
You must be signed in to fork a gist
-
Save simonw/848a3b91169a789bc084a459aa7ecf83 to your computer and use it in GitHub Desktop.
Run like this: uv run https://gist.githubusercontent.com/simonw/848a3b91169a789bc084a459aa7ecf83/raw/397ad07c8be0601eaf272d9d5ab7675c7fd3c0cf/follow_theirs.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# dependencies = [ | |
# "atproto" | |
# ] | |
# /// | |
from atproto import Client | |
import getpass | |
import time | |
def follow_user_follows(client, target_user): | |
"Follow everyone the target_user is following." | |
cursor = None | |
total_followed = 0 | |
while True: | |
# Step 1: Fetch a batch of accounts the target user is following | |
# https://docs.bsky.app/docs/api/app-bsky-graph-get-follows | |
response = client.app.bsky.graph.get_follows( | |
{"actor": target_user, "limit": 100, "cursor": cursor} | |
) | |
# Step 2: Iterate through the accounts | |
for follow in response.follows: | |
try: | |
# Step 3: Follow each account | |
client.follow(follow.did) | |
print(f"Following {follow.handle}") | |
total_followed += 1 | |
# Step 4: Add a delay to respect rate limits | |
time.sleep(2) | |
except Exception as e: | |
print(f"Error following {follow.handle}: {str(e)}") | |
# Step 5: Check for more accounts to follow | |
if not response.cursor: | |
break | |
cursor = response.cursor | |
# Step 6: Print progress | |
print(f"Followed {total_followed} users so far") | |
# Step 7: Print final result | |
print(f"Finished following {total_followed} users") | |
if __name__ == "__main__": | |
# Step 8: Set up credentials | |
USERNAME = input("your_username.bsky.social ") | |
APP_PASSWORD = getpass.getpass("your_app_password ") | |
TARGET_USER = input("target_user.bsky.social ") | |
# Step 9: Initialize and authenticate client | |
client = Client() | |
client.login(USERNAME, APP_PASSWORD) | |
# Step 10: Execute the follow process | |
follow_user_follows(client, TARGET_USER) |
To clarify: this is a fork of the original script by Hamel here: https://gist.github.com/hamelsmu/fb9ed633de7d784619e4b6da5039e6ae
I added the inline dependency metadata and the input()
and getpass()
bits.
You can see the changes I made here, I also ran it through Black: https://gist.github.com/simonw/848a3b91169a789bc084a459aa7ecf83/revisions
This skips the actual following:
# Step 2: Iterate through the accounts
for follow in response.follows:
print(follow)
continue # never follows
try:
...
This skips the actual following:
Oops! Fixed that now, thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can’t perform that action at this time.
Uh oh!
There was an error while loading. Please reload this page.