
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
bsky-bridge
is a Python library designed to bridge the interaction between Python applications and the BlueSky Social Network via its API.
pip install bsky-bridge
Start by establishing a session with your BlueSky handle and App passwords (To be created in your account settings).
from bsky_bridge import BskySession
session = BskySession("your_handle.bsky.social", "your_APPpassword")
You can also specify a custom directory for storing the session file (By default it will be ".bsky_sessions" in the current directory).
from bsky_bridge import BskySession
session = BskySession("your_handle.bsky.social", "your_APPpassword", "/custom/path/to/sessions")
After initializing a session, you can post text to BlueSky:
from bsky_bridge import BskySession, post_text
session = BskySession("your_handle.bsky.social", "your_APPpassword")
response = post_text(session, "Hello BlueSky!")
print(response)
To post images along with text, you can use the post_image
method:
from bsky_bridge import BskySession, post_image
session = BskySession("your_handle.bsky.social", "your_APPpassword")
postText = "Check out this cool image!"
imagePath = "path_to_your_image.jpeg"
altText = "An awesome image"
response = post_image(session, postText, imagePath, altText)
print(response)
Note: The library automatically handles resizing and compressing larger images to ensure they do not exceed 1 MB in size, all while maintaining a quality balance. This ensures efficient and quick image uploads.
To specify the languages of your post, simply add the langs parameter.
from bsky_bridge import BskySession, post_image
# Initialize the session
session = BskySession("your_handle.bsky.social", "your_APPpassword")
# Define your post text and specify languages
text = "Bonjour le monde!\nHello World!"
specified_langs = ["fr", "en-US"]
# Post the text with specified languages
response = post_text(session, text, langs=specified_langs)
print(response)
# Define your post text, image path, alt text, and specify languages
post_text_content = "Check out this beautiful sunset!\nมองดูพระอาทิตย์ตกที่สวยงามนี้!"
image_path = "sunset.jpeg"
alt_text = "Sunset over the mountains"
specified_langs = ["en-US", "th"]
# Post the image with specified languages
response = post_image(
session,
post_text_content,
image_path,
alt_text,
langs=specified_langs
)
print(response)
Contributions are welcome! Please submit issues for any bug or problem you discover, and pull requests for new features or fixes.
FAQs
A Python interface for interacting with the BlueSky social network's API.
We found that bsky-bridge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.