Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
🎉 #14
🎉 #14
Changes from 2 commits
89b2e03
934a753
1206509
0da0003
9aafd3d
c110cbb
56d64ca
27ea4bc
e0d0d75
baade67
2bc8409
7b37bc3
b6b76b7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
Create new tootGalaxy Social
This repository strives to democratise Galaxy's social media activity. The aim is to encourage collaboration, editing, peer-review of toots and much more. In addition, we might add bots and support to automatise social media activity of awesome community contributions such as PRs, new tools, or events on the Galaxy Hub.
How to
tootCreate a Posttl;dr Create new toot
Create a new *.toot file in this ./toots/ folder. For more details please consult this Readme.
To create a post on Galaxy Social, follow these steps:
Create a Branch: Begin by creating a branch in this repository or your forked repository.
Add a New File: Within the "posts" folder (or sub-folders), create a new file with the extension ".md" and commit it to your branch.
Use the Post Template: Utilize the following template for the post content:
Notes on the Template:
Everything between the two
---
are metatags and should be in YAML format."media" (Required): Ensure the media name is implemented inside the
plugins.yml
."images" (Optional): Include links to desired images. The alt_text is optional but recommended.
"mentions" and "hashtags" (Optional): Follow the specified format as shown in the template.
"Your text content goes here." (Required): This is the content that will be posted to social media platforms. When the character limit is reached on a social media, it will be divided into several posts as a thread.
Create a Pull Request: Once your post is ready, create a pull request to the main branch.
Preview and Review: After each pull request, the "Create Preview" GitHub action will run. It will preview the content as a comment to the pull request and highlight any errors that need to be fixed before merging.
Publish Your Content: Upon merging the pull request, the "Publish Content" GitHub action will run. The results will be added to
processed_files.json
in the processed_files branch.By following these steps, you can effectively create and publish posts on Galaxy Social.
Add a New Social Media Platform
Expanding the capabilities of Galaxy Social by adding a new social media platform is a straightforward process. Follow these steps to integrate a new platform:
Create a Plugin File: Begin by adding a Python file to the
lib/plugins
folder. This file should contain a class with a function namedcreate_post(content, mentions, hashtags, images, alt_texts)
. This function will handle the process of sending announcements to the desired social media platform.Update plugins.yml: Next, update the
plugins.yml
file to include the new social media platform. Follow this template:Ensure to replace
name_of_the_media
with the name of the new platform, andfile_name.class_name
with the appropriate file and class name for the plugin. Thename
is then used in themedia
tag in the post file (posts/*.md) to determine the social media.Configuration: In the
config
section, specify any required variables for initializing the plugin class. This may include authentication tokens, room IDs, or other platform-specific parameters.GitHub Secrets: Add any tokens or variables required for the plugin to GitHub secrets. This ensures sensitive information is securely stored. Refer to GitHub secrets documentation for guidance on creating secrets.
Enable the Plugin: Simply set
enabled: true
to enable the new social media platform. This ensures that it will be implemented when creating posts.Update publish_content.yml: Finally, update the
publish_content.yml
file to include an environment variable referencing the token saved in GitHub secrets. Use the following template:Replace
TOKEN_SAVED_IN_GITHUB_SECRETS
with the name of the secret containing the token for the new social media platform.By following these steps, you can seamlessly integrate a new social media platform into Galaxy Social, expanding its reach and functionality.
Duplicate a Social Media Platform with Different Token
If you need to use the same social media platform with different authentication tokens, you can duplicate the entry in the
plugins.yml
file. Follow these steps:Duplicate Entry: Copy the entry for the social media platform in the
plugins.yml
file and paste it below the original entry.Update Name and Tokens: Change the name of the duplicated entry to reflect the new configuration, and replace the token with the new authentication token.
Configuration: Adjust any other configuration parameters as needed for the duplicated entry.
Use Name in Post: Remember that the name you specify in the
plugins.yml
file must also be used within themedia
tag when creating a post. Ensure consistency to link the post with the correct social media platform.By following these steps, you can effectively duplicate a social media platform with a different token for specific use cases or configurations.
Social media implemented