Skip to content

This is an aggregator for groups / events across a variety of services, which is then outputted on a website, in a JSON format, and a iCal file (which can be added/shown in a calendar).

Notifications You must be signed in to change notification settings

inevitable-team/compiled-mcr-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CompiledMCR Events (Manchester Tech Meetups)

This is an aggregator for groups / events across a variety of services, which is then outputted on a website, in a JSON format, and a iCal file (which can be added/shown in a calendar).

OLD VERSION: https://github.com/Sean12697/MeetupManchesterTech

Table of Contents

Prerequisites

To start using this project, you will need to have the following programs installed:

Installation

Once you have NodeJS installed, run the following command at the root of the project to download all the dependencies:

npm i

Configuration

If you wish to modify the project you will likely wish to modify the following aspects.

Sources

The source code that pulls in the groups/events from the various sources can be found in ~/_data/dataGather.js.

This script requires the declaration of class files specified with a getData() function that returns a 2D array of [ [group], [event] ].

Meetup

The Meetup class uses group IDs from ~/_data/sources/groupIds/meetup.js for now, which can be updated/replaced with ease (no other API requirements).

EventBrite

The EventBrite class uses organizations objects from ~/_data/sources/groupIds/eventbrite.js for now, which can be updated/replaced with ease.

Eventbrite does require an API key, which can be found on their website, although a Public key is being used in this example which works.

As of 12/12/19 there has been a "Event Search API Shut Down", which means an API Key/Token is required, which can be found on their website. This can be set under the environment variables as EVENTBRITE_TOKEN, or set as the only parameter for the Eventbrite setup in the dataGather.

Google Calendar

The Google Calendar class can be found ~/_data/sources/googleCalendar.js, which can be initialized with another Calendar ID, with the example of the TechNW calendar below:

this.googleCalendar = new googleCalendar("a73q3trj8bssqjifgolb1q8fr4@group.calendar.google.com", "https://technw.uk/calendar", "TechNW", googleCalendarKey)

Github Action

Once deployed, where npm start is ran, there is no built in / automated way to update the website and pull new events by default. There are many solutions for this, often involving some type of cron job to rebuild the website on a daily basis, which is recommended due to events finishing and the potential of new events being added.

Within this repository there is a Github Action called main.yml, to configure the Cron job there are two main steps, changing the the repo name in the if statement and placing the build hook into the repositories secrets.

      - if: github.repository == "inevitable-team/compiled-mcr-events"
        name: Curl request
        run: curl -X POST -d {} ${{ secrets.BUILD_HOOK }}

It must be noted that this is currently setup to work with the Repository being hosted on GitHub (to take advantage of Github Actions & Repository Secrets) and being deployed to Netlify.

If you do intend to use a different pipeline it is recommended to modify the code for this, or get in touch if you are facing any issues.

If Statement

The line that includes inevitable-team/compiled-mcr-events should be changed to match the main repo's name, this is to ensure that any forks of the project do not attempt to trigger the cron job as well.

Build Hook

If you visit https://app.netlify.com/sites/${ netlify_project_name }/settings/deploys#build-hooks you will find the area to generate your build hook, this "give you a unique URL you can use to trigger a build".

If you wish to learn more about Build Hooks visit the Netlify Docs.

Usage

Once installed and configured, you can then run the following command:

npm run start

Which will then generate the website in the _site folder, along with the following files within that folder:

  • ical: ~/data/events.ical
  • Events JSON: ~/data/events.json
  • Groups JSON: ~/data/groups.json

Deploying

If you wish to deploy this as a service, the recommended way would be to push it to Netlify, with npm start as the build command and _site as the build directory.

Contributing

This project is part of the much greater CompiledMCR project (infrastructure below), meaning potentially only minor PR's will be accepted for refinements, feature updates and bug fixes.

If you do wish to fork it for another city, please do link back and a central Compiled website will be constructed soon.

CompiledMCR Project Infrastructure

About

This is an aggregator for groups / events across a variety of services, which is then outputted on a website, in a JSON format, and a iCal file (which can be added/shown in a calendar).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published