Exemplo n.º 1
0
	var talk DevTalk
	err = json.Unmarshal(b, &talk)
	if err != nil {
		hal.Logger.Error(err)
		return res.Send("Sorry, I don't have a URL for today's live stream.  You can check if it is posted to the Meeup page at http://www.meetup.com/chadevs/ or our Google+ page at https://plus.google.com/b/103401260409601780643/103401260409601780643/posts")
	}

	if talk.Date != t.Format("2006-01-02") {
		return res.Send("Sorry, I don't have a URL for today's live stream.  You can check if it is posted to the Meeup page at http://www.meetup.com/chadevs/ or our Google+ page at https://plus.google.com/b/103401260409601780643/103401260409601780643/posts")
	}

	return res.Send(fmt.Sprintf("You can access the live stream for the talk here %s", talk.URL))
})

var devlunchRSVPHandler = hear(`devlunch rsvps`, "devlunch rnvps", "Gets the RSVP count for Chadev Dev Lunches", func(res *hal.Response) error {
	rsvp, err := meetup.GetMeetupRSVP("chadevs")
	if err != nil {
		hal.Logger.Errorf("failed fetching RSVP information: %v", err)
		res.Send("I was unable to fetch the latest RSVP information for this group")
		return err
	}

	if rsvp != "" {
		res.Send(fmt.Sprintf("Dev Lunch RSVP breakdown: %s", rsvp))
	} else {
		res.Send("There are either no upcoming dev lunches or no RSVP for the event yet")
	}

	return nil
})
Exemplo n.º 2
0
	group := searchGroups(g, name)
	for _, u := range group.Urls {
		if u.Name == "website" || u.Name == "meetup" {
			m := parseMeetupName(u.URL)
			if m != "" {
				group.meetup = m
			}
		}
	}

	if group.meetup == "" {
		res.Send(fmt.Sprintf("%s is using an unsupported event system, can't fetch RSVP information", group.Name))
		return nil
	}

	rsvp, err := meetup.GetMeetupRSVP(group.meetup)
	if err != nil {
		hal.Logger.Errorf("failed fetching RSVP information: %v", err)
		res.Send("I was unable to fetch the latest RSVP informaion for this group")
		return err
	}

	if rsvp != "" {
		res.Send(fmt.Sprintf("%s RSVP breakdown: %s", group.Name, rsvp))
	} else {
		res.Send("There are either no upcoming events or no RSVP for the event yet")
	}

	return nil
})