Later.com Puppeteer Script
This is a puppeteer automation script to auto-schedule Instagram, Facebook and Twitter posts through Later.com.
- 2.1. Built With
Well, Facebook & Instagram's API is a shit-show. The whole thing is just a pain. Therefore, Later.com has a nice interface that doesn't change very often (which makes it predicatble) and easier to script. Also, Later.com gives the following:
- Free 30 posts per month for an entire social set.
- Free Instagram Videos (not just images)
- Free scheduling
- Their DOM is also easier to script - no random class names and obfuscation like facebook.
So, basically, this is a great service for free.
This project was built with the following frameworks, technologies and software.
You need to setup three secrets in your github repo:
LATER_PASSWORD=> This is your password for later.com so puppeteer can login.
LATER_USERNAME=> Later.com username
RCLONE_CONF=> This is the configuration file for rclone. Allows you to login to google drive, etc...
This github action will do the following things:
- Create a new ubuntu runner.
- Copies this repository onto it.
- Uses WGET to grab a copy of all text / schedule / media needed.
- Downloads any specified media using RClone
- Set permissions
- Installs Puppeteer through my own puppeteer action (https://github.com/IORoot/action__puppeteer--media)
- Runs the code in
puppeteer.jsin this repository with puppeteer.
- Uploads the screenshots (for debugging) as an artifact.
It's pretty simple really... The config in
.github/workflows/puppeteer.yml has a single environment variable called
remote. This points to a server that has all of your text files on it.
The text files on your remote server are called:
The runner will download these using
wget and use the contents.
This contains, surprise, surprise, the schedule of when to post your posts. In the Format:
DD MM HH mm AM/PM
21 09 12 20 PM
The contents of this file will be automatically appended to the bottom of the Instagram and Facebook posts, but not Twitter.
This file contains the location of the video file of the post. I originally used a google drive location (the details are commented out in the runner config yaml), but decided to host directly on my own server, So this contains a single line with the location of that video file.
The other files all contain the main teext to add to the post for that specific channel.
IG = Instagram FB = Facebook TW = Twitter
Just run the github action as a manual step in thee "actions" tab.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue. Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature)
- Commit your Changes (
git commit -m 'Add some AmazingFeature')
- Push to the Branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
Distributed under the MIT License.
Copyright (c) 2022 Andy Pearson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Author Link: https://github.com/IORoot
- v1.0.0 - Initial Commit