meetupGCal

package module
v0.0.0-...-430a9e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2016 License: GPL-3.0 Imports: 15 Imported by: 0

README

meetupGCal

This Go library provides some useful functions to extract info from the meetup.com and interfaces with Google calendar API to add events.

In order to get the tokens for accessing the Calendar, follow the steps here. https://developers.google.com/google-apps/calendar/quickstart/go#prerequisites

Apart from this, you will also need to provide a config file of the following format

{
	"calendarId":"This is the id of the calendar you want to update. The id can be found in the settings",
	"meetupKey": "The meetup API key",
	"groupsFile":"https://raw.githubusercontent.com/logzer0/dfw-tech-calendar/master/groups.csv -- sample file",
	"zip": "zip code. The program looks for groups in a radius of 50mi"
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigFilePath string
)

Functions

func AddEventToGCal

func AddEventToGCal(event *calendar.Event)

func Call

func Call(url string) (resp []byte, err error)

func ConvertMeetupEventToGCalEvent

func ConvertMeetupEventToGCalEvent(group Group, event Event) *calendar.Event

func UpdateCalendar

func UpdateCalendar()

Types

type Config

type Config struct {
	CalendarId   string `json:"calendarId"`
	MeetupKey    string `json:"meetupKey"`
	GroupsFile   string `json:"groupsFile"`
	LookupEvents string `json:"lookup"`
	Zip          string `json:"zip"`
}

json config to provide the data

type Event

type Event struct {
	Created       int64  `json:"created"`
	Duration      int    `json:"duration"`
	ID            string `json:"id"`
	Name          string `json:"name"`
	RsvpLimit     int    `json:"rsvp_limit"`
	Status        string `json:"status"`
	Time          int64  `json:"time"`
	Updated       int64  `json:"updated"`
	UtcOffset     int    `json:"utc_offset"`
	WaitlistCount int    `json:"waitlist_count"`
	YesRsvpCount  int    `json:"yes_rsvp_count"`
	Group         struct {
		Created  int64   `json:"created"`
		Name     string  `json:"name"`
		ID       int     `json:"id"`
		JoinMode string  `json:"join_mode"`
		Lat      float64 `json:"lat"`
		Lon      float64 `json:"lon"`
		Urlname  string  `json:"urlname"`
		Who      string  `json:"who"`
	} `json:"group"`
	Link        string `json:"link"`
	Description string `json:"description"`
	Venue       struct {
		ID                   int     `json:"id"`
		Name                 string  `json:"name"`
		Lat                  float64 `json:"lat"`
		Lon                  float64 `json:"lon"`
		Repinned             bool    `json:"repinned"`
		Address1             string  `json:"address_1"`
		Address2             string  `json:"address_2"`
		Address3             string  `json:"address_3"`
		City                 string  `json:"city"`
		Country              string  `json:"country"`
		LocalizedCountryName string  `json:"localized_country_name"`
	} `json:"venue"`
	Visibility string `json:"visibility"`
}

Event is the data type for a meetup event

type Group

type Group struct {
	Score                float64 `json:"score"`
	ID                   int     `json:"id"`
	Name                 string  `json:"name"`
	Link                 string  `json:"link"`
	Urlname              string  `json:"urlname"`
	Description          string  `json:"description"`
	Created              int64   `json:"created"`
	City                 string  `json:"city"`
	Country              string  `json:"country"`
	LocalizedCountryName string  `json:"localized_country_name"`
	State                string  `json:"state"`
	JoinMode             string  `json:"join_mode"`
	Visibility           string  `json:"visibility"`
	Lat                  float64 `json:"lat"`
	Lon                  float64 `json:"lon"`
	Members              int     `json:"members"`
	Organizer            struct {
		ID    int    `json:"id"`
		Name  string `json:"name"`
		Bio   string `json:"bio"`
		Photo struct {
			ID          int    `json:"id"`
			HighresLink string `json:"highres_link"`
			PhotoLink   string `json:"photo_link"`
			ThumbLink   string `json:"thumb_link"`
		} `json:"photo"`
	} `json:"organizer"`
	Who        string `json:"who"`
	GroupPhoto struct {
		ID          int    `json:"id"`
		HighresLink string `json:"highres_link"`
		PhotoLink   string `json:"photo_link"`
		ThumbLink   string `json:"thumb_link"`
	} `json:"group_photo"`
	Timezone  string `json:"timezone"`
	NextEvent struct {
		ID           string `json:"id"`
		Name         string `json:"name"`
		YesRsvpCount int    `json:"yes_rsvp_count"`
		Time         int64  `json:"time"`
		UtcOffset    int    `json:"utc_offset"`
	} `json:"next_event"`
	Category struct {
		ID        int    `json:"id"`
		Name      string `json:"name"`
		Shortname string `json:"shortname"`
		SortName  string `json:"sort_name"`
	} `json:"category"`
	Photos []struct {
		ID          int    `json:"id"`
		HighresLink string `json:"highres_link"`
		PhotoLink   string `json:"photo_link"`
		ThumbLink   string `json:"thumb_link"`
	} `json:"photos"`
}

Group is the data type for a meetup group

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL