/calengram

Calengram fetch events from a Google Calendar daily and post thems as a Story on Instagram.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Calengram

GitHub license

Table of Contents

About The Project

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!

Built With

Getting Started

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.

Prerequisites

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

Installation

  1. Setup your base_calendar.png image and adjust margin and other image settings on instagramApiService if needed.
  2. (Optional) Setup a Google App if you want to retrieve channels from a spreadsheed. Follow the Node Quickstart Guide to download credentials.json.
  3. Clone the repository
    git clone https://github.com/pvillaverde/calengram
  4. Install NPM packages dependencies
    npm install
  5. Copy config_example.js as config.js and enter your calendarId as well as the content of credentials.json on google_credentials.
     calendarId: 'galegotwitch@gmail.com',
     google_credentials: {/*credentials.json*/},
  6. 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,
     },
  7. Start the app by runing npm start or node app/index.js and follow the steps for google Api auth.
  8. 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

Usage

As you have seen previously, you can choose how the app learns which channels to check from 2 options:

  1. Defining the twitch.channels variable on config.js with an array of channels name, ex:// [clankirfed,twitch_en_galego]
  2. Setting up Google Sheets API and specifying a Google Spreadsheet on config.jswhich 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)
	},
  1. 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.

Customizing refresh intervals

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 )

Roadmap

Check out the open issues page for a list of proposed features (and known issues).

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Authors

Pablo Villaverde Castro - @clankirfed

Acknowledgements

License

GitHub license

Distributed under the GNU GPL-v3 License. See LICENSE for more information.