npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

webuild-events

v1.4.39

Published

generates a list of free and open tech events in your city

Downloads

117

Readme

#webuild-events

Get a list of free developer-related events in your city from facebook, meetup.com, eventbrite, ics url and manual entries.

##install

npm i webuild-events

##usage

  1. we will create the following folder structure:

    .
    ├── .env
    ├── config
    │   ├── blacklistEvents.json
    │   ├── facebookGroups.json
    │   ├── icsGroups.json
    │   └── whitelistEvents.json
    ├── config.js
    ├── node_modules
    │   ├── dotenv
    │   └── webuild-events
    └── index.js
  • create a .env file to store all the environment variables:

    NODE_ENV=development
    LOCATION=Singapore # name of city
    WEBUILD_API_SECRET=secret # any random string - used as a password when remotely refreshing the feeds
    MEETUP_API_KEY=secret # generate it from https://secure.meetup.com/meetup_api/key/ to get meetup.com events
    EVENTBRITE_TOKEN=secret # generate it from http://developer.eventbrite.com/ to get eventbrite events
    
    # Create an Auth0 https://auth0.com/ account and a Facebook app and link them (https://docs.auth0.com/facebook-clientid). Configure the `WEBUILD_AUTH0_CLIENT_*` environment variables.`
    WEBUILD_AUTH0_CLIENT_ID=secret
    WEBUILD_AUTH0_CLIENT_SECRET=secret
  • create a json file config/facebookGroups.json to list all the Facebook pages / groups you want to list the upcoming events:

    [
      {
        "name": "Adobe InDesign Singapore User Group", // name of the facebook page / group
        "id": "116531348396769" // id of the facebook page / groups: https://lookup-id.com/
      },
    	...
    ]
  • create 2 json files config/blacklistEvents.json and config/whitelistEvents.json to add / remove events manually:

    [
      {
        "id": "999999999",
        "name": "This is a sample event on how to fill up this file. For whitelistEvents.json: all fields are required. For blacklistEvents.json: id, formatted_time and url are required. Time fields are filled in as an example for time format DD MMM YYYY, ddd, h:mm a.",
        "description": "sample description",
        "location": "sample location",
        "url": "http://www.sample.com/event",
        "group_name": "sample group name",
        "group_url": "http://www.group.com",
        "formatted_time": "14 Nov 2014, Fri, 6:00 pm",
        "start_time": "2014-11-14T10:00:00.000Z",
        "end_time": "2014-11-16T09:00:00.000Z"
      },
      ...
    ]
  • create a json file config/icsGroups.json to list all urls of ics formatted events:

    [
      {
        "group_name": "KopiJS",
        "group_url": "http://kopi.io/",
        "ics_url": "https://www.google.com/calendar/ical/dnhunu42fotmefouusg4j8ip0k%40group.calendar.google.com/public/basic.ics"
      },
      ...
    ]
  • create a file config.js with the following contents:

    var city = 'Singapore'; // name of your city E.g. 'Sydney'
    var country = 'Singapore'; // name of your country E.g. 'Australia'
    var locationSymbol = 'SG'; // country code: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements
    
    function failSafeRequire(filename){
      var requiredData;
      try {
       requiredData  = require(filename);
      }
      catch(e){
        requiredData = [];
      }
      return requiredData;
    }
    
    var facebookGroups = failSafeRequire('./config/facebookGroups.json');
    var blacklistEvents = failSafeRequire('./config/blacklistEvents.json')
    var icsGroups = failSafeRequire('./config/icsGroups.json');
    var whitelistEvents = failSafeRequire('./config/whitelistEvents.json');
    var duplicateWords = require('./config/duplicateWords.json')[0].words; // see sample in examples/duplicateWords.json
    
    module.exports = {
      location: city,
      city: city,
      country: country,
      symbol: locationSymbol,
    
      api_version: 'v1',
    
      displayTimeformat: 'DD MMM YYYY, ddd, h:mm a', // format date: http://momentjs.com/docs/#/displaying/
      dateFormat: 'YYYY-MM-DD HH:mm Z', // format time: http://momentjs.com/docs/#/displaying/
      timezone: '+0800', // timezone UTC offset: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      timezoneInfo: 'Asia/Singapore', // timezone name: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
    
      debug: process.env.NODE_ENV === 'development',
    
      ignoreWordsInDuplicateEvents: duplicateWords, // array of words to ignore in detecting duplicate events
    
      auth0: {
        domain: 'webuildsg.auth0.com',
        clientId: process.env.WEBUILD_AUTH0_CLIENT_ID,
        clientSecret: process.env.WEBUILD_AUTH0_CLIENT_SECRET
      },
    
      meetupParams: {
        key: process.env.MEETUP_API_KEY,
        country: locationSymbol,
        state: locationSymbol,
        city: city,
        category_id: 34, // Tech category
        page: 500,
        fields: 'next_event',
    
        blacklistGroups: [],
        blacklistWords: [],
      },
    
      eventbriteParams: {
        token: process.env.EVENTBRITE_TOKEN,
        url: 'https://www.eventbriteapi.com/v3/events/search',
        categories: [
          '102',
          '119'
        ],
        blacklistOrganiserId: []
      }
    };
    
  • create index.js:

    require('dotenv').load();
    var config = require('./config');
    var events = require('webuild-events').init(config).events;
    
    setTimeout(function() {
      console.log('Found ' + events.feed.events.length + ' events from Facebook:')
      console.log('\nMeta info:')
      console.log(events.feed.meta)
      console.log('\nFirst event info:')
      console.log(events.feed.events[0])
    }, 30000);
  • install the relevant dependencies:

    npm i webuild-event
    npm i dotenv
  • run the file with node index.js

#contribute

Please see CONTRIBUTING.md for details.

#versioning

Following the Semantic Versioning guidelines, run the grunt bump, grunt bump:minor or grunt bump:major commands to bump the version accordingly.

#license

webuild-events is released under the MIT License.