Calengram fetch events from a Google Calendar daily and post thems as a Story on Instagram.
Miss the one you wanted? Request a feature or consider contributing to the project!
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
Project is build on node and uses many npm packages, You need to set up:
- NodeJS: Follow the instructions on the webpage.
- npm
npm install npm@latest -g
- Setup your
base_calendar.png
image and adjust margin and other image settings on instagramApiService if needed. - (Optional) Setup a Google App if you want to retrieve channels from a spreadsheed. Follow the Node Quickstart Guide to download
credentials.json
. - Clone the repository
git clone https://github.com/pvillaverde/calengram
- Install NPM packages dependencies
npm install
- Copy
config_example.js
asconfig.js
and enter your calendarId as well as the content of credentials.json ongoogle_credentials
.calendarId: 'galegotwitch@gmail.com', google_credentials: {/*credentials.json*/},
- Setup other settings: Max events per story, if user should be mentioned and credentials for the instagram user.
maxStoryEvents: 9, // Max events per story image. maxEventLength: 64, // Max characters per event mentionAlways: false, // Wheter or not to mention OUR user on every story. instagram: { id: '', // Instagram User ID username: '', // Instagram User Email password: '', // Instagram User Password publishNoEvents: false, // Set to true if you want to publish story even if there aren't events }, discord: { channelId: null, // Discord channel ID (string. If null discord wont be used) bot_token: null, // Discord bot Token (string. If null discord wont be used) days: 4, },
- Start the app by runing
npm start
ornode app/index.js
and follow the steps for google Api auth. - If you want to launch a docker, once you have all setup and ready, build the image and run it with:
docker build -t pvillaverde/calengram . docker run --name calengram -d pvillaverde/calengram
As you have seen previously, you can choose how the app learns which channels to check from 2 options:
- Defining the
twitch.channels
variable onconfig.js
with an array of channels name, ex://[clankirfed,twitch_en_galego]
- Setting up Google Sheets API and specifying a Google Spreadsheet on
config.js
which shall have the channels names on the first column:
google_spreadsheet: { // set to null if dont want to use mentions
id: '1AFbvk9SLOpOyST4VWG6IOkiMdclzExUPQrKUBuEUHKY', // Google Spreadsheet ID
range: 'Canles!A2:C', // Sheet & Range
headers: 'name,iguser,igid', // Column Headers (Use them for specifying channel name, instagram @user and Instagram ID)
},
- If for any reason whatsoever you need to post a story on startup, you can set the environment variable
CALENGRAM_POST_ON_STARTUP=true
in your system or docker image.
Lastly, you can choose when to retrieve each data on the cron
option of config.js
, by default it is setup like this:
// Minutes Hours DayOfMonth Month DayOfWeek
fetchEvents: '0 8 * * *', // Events will be fetched from calendar each day at 8AM
These intervals can be customized using the cron syntax:
* * * * * *
| | | | | |
| | | | | day of week
| | | | month
| | | day of month
| | hour
| minute
second ( optional )
Check out the open issues page for a list of proposed features (and known issues).
If you want to add any missing feature or storage that feed your needs, go ahead! That's what make the open source community shines, by allowing us to grow and learn from each other creating amazing tools! Any contribution you make is greatly appreciated.
- 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
Pablo Villaverde Castro - @clankirfed
- Instagram Private API
- Ultimate Text to Image
- How to use Node Cron
- TOC Generator
- Dockerizing NodeJs WebApp
- Building Efficient NodeJS DockerFiles
Distributed under the GNU GPL-v3 License. See LICENSE
for more information.