Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for posting without a file #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidgs
Copy link

@davidgs davidgs commented Feb 10, 2025

This should allow you to post without a file uploaded

@seldo
Copy link
Contributor

seldo commented Feb 10, 2025

Thank you for the PR! You will also need to modify https://github.com/run-llama/crossposter/blob/main/frontend/src/app/api/post/route.ts to only upload media attachments if they are present; at the moment posting fails with a 500 on all 3 services.

@davidgs
Copy link
Author

davidgs commented Feb 10, 2025

Can you send me the console output when you try to post without media?

I would expect that

 const platform = formData.get('platform') as string;

    console.log("Attached Media", media)

would print null if there's no media.

@seldo
Copy link
Contributor

seldo commented Feb 10, 2025

That's true! Unfortunately one needs to handle this in several other places:

  1. Here: https://github.com/run-llama/crossposter/blob/main/frontend/src/app/api/post/route.ts#L60-L75

You need to check if there's media and neither upload it nor attempt to create a tweet with media IDs attached.

  1. Here: https://github.com/run-llama/crossposter/blob/main/frontend/src/app/api/post/route.ts#L98-L103

This is the most troublesome; the library for LinkedIn doesn't have a post-without-media option! You need to add one.

  1. Here: https://github.com/run-llama/crossposter/blob/main/frontend/src/app/api/post/route.ts#L123-L131

You likewise need to modify the bluesky poster to have an option to post without attached media.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants