![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
blueskysocial is a Python library for managing social media posts and images. It provides a Client class for interacting with social media platforms, as well as classes for representing posts and images.
To install blueskysocial, you can use pip:
pip install blueskysocial
from blueskysocial import Client, Post, Image
client = Client()
client.authenticate(user_name, password)
image = Image('path/to/image.jpg', alt_text='This is an image.')
post = Post('Hello, world!, This is my first post.', with_attachments=[image])
client.post(post)
from blueskysocial import Client, Post, Image
client = Client()
client.authenticate(user_name, password)
image = Image('path/to/image.jpg', alt_text='This is an image.')
post = Post('Hello, world!, This is my first post.', with_attachments=[image])
second_post = Post('Another Post')
client.post_thread([post,second_post])
As of version 1.5.0, embedding video in your post is supported. Currently video can only be embedded from a local file. Please note, that when embedding a video in a post, it may take several minutes for Bluesky to process your video, during which a video frame with "Video Not Found" will appear in your post.
The following video formats are supported
from blueskysocial import Client, Post, Video
client = Client()
client.authenticate(user_name, password)
video = Video('path/to/video.mov')
post = Post('Video Post', with_attachments=video)
client.post(post)
Bluesky counts URL characters towards the 300 character limit. The solution to this is to format your links. blueskysocial
supports markdown link formatting. If you format your post text in the following fashion
from blueskysocial import Client, Post
client = Client()
client.authenticate(user_name, password)
post = Post('Hello, world!, This is my first post. But with a link. [Click here](http://really.long.url.here)'),
clinet.post(post)
Your post text will be "Hello, world!, This is my first post. But with a link. Click here", with the words "Click here" being a link. In this fashion, only the characters in "Click here" count towards the limit
Webcards are the small preview images of a linked website that appear at the bottom of the posts and also serve as links. You can embed a webcard with the following syntax
from blueskysocial import Client, Post, WebCard
client = Client()
client.authenticate(user_name, password)
webcard = WebCard("http://url_to_link_to.com/article")
post = Post('Check out this article!', with_attachments=webcard)
clinet.post(post)
Get all convos and show the member and last message of the last conversation
convos = client.get_convos()
print(convos[-1].participant)
print(convos[-1].last_message)
Get convos based ona filter. Many other filters are available, this is not an exhaustive list
convos = client.get_convos(
bs.F.And(
bs.F.Eq(bs.F.Participant, 'someusername.bsky.social'),
bs.F.GT(bs.F.LastMessageTime, '2024-01-01')
)
)
print(convos[-1].participant)
print(convos[-1].last_message)
Get all messages in a conversation
messages = convos[-1].get_messages()
print(messages[0].sent_at)
print(messages[-1].sent_at)
print(messages[0].text)
Please notice that the message list is ordered such that last message is first
2024-11-26 12:47:31.704000
2024-11-22 22:33:38.323000
Great stuff!
Get a conversation with a specific member or members. This is also how you create a new conversation if you want to DM someone you haven't sent messages to before
convo = client.get_convo_for_members('someusername.bsky.social')
Send a message
convo.send_message('Hello, World!')
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
blueskysocial is licensed under the MIT License. See LICENSE for more information.
FAQs
API for BlueSky social network
We found that blueskysocial 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.