Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔈 qbsky

Dead simple AWS SQS to Bluesky serverless poster 🔈.

Publish message 💌 to SQS (FIFO), Lambda function will handle publishing posts to Bluesky. Automagically. 🎉

Honestly, my intention is to automate the sharing of specific information through the use of this queue in several side projects. I'm bringing this to your attention because I couldn't find a comparable solution on Github or in open-source projects. I'm hopeful that it may prove useful to someone else.

🚀 Getting started

Update variables in Makefile and tf/variables.tf according to your environment.

  • type make to get started (help)

Requirements

  1. AWS Account
  2. Bluesky Account
  3. Terraform App

How to deploy on your AWS Account

  • make all (all-in-one command)

Manual - Under the hood (for Plumbers)

  1. make tf-package (create the artifact and push to S3)
  2. make tf-init (to prepare terraform deployment)
  3. make tf-apply Deploy the infrastructure

nb: Terraform is using remote state on S3.

Setup Bluesky secrets

After you've deployed the Terraform you will need to set Bluesky API credentials manually to AWS Secret Manager using AWS console.

Set the following credentials in AWS Secret Manager: bluesky_handle and bluesky_password

🗯️ How to publish a message

Using AWS Console

Send messages

Using AWSCLI

aws sqs send-message --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --message-body "Hello Folks!" --delay-seconds 10 --message-attributes file://send-message.json

AWS Documentation

🐍 Using Python (boto3)

import boto3

# Create SQS client
sqs = boto3.client('sqs')

queue_url = 'SQS_QUEUE_URL'

# Send message to SQS queue
response = sqs.send_message(
    QueueUrl=queue_url,
    DelaySeconds=10,
    MessageAttributes={
        'Title': {
            'DataType': 'String',
            'StringValue': 'My Bluesky Post'
        },
        'Author': {
            'DataType': 'String',
            'StringValue': 'John Doe'
        }
    },
    MessageBody=(
        'Hello Bluesky! This is a test post from AWS SQS.'
    )
)

print(response['MessageId'])

AWS Documentation

📝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

🧘 License

MIT

🐒 Credits

About

AWS SQS to Bluesky Automation

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages