예제 #1
0
        public static List <MeetupSponsors> Get()
        {
            List <MeetupSponsors> sponsors = new List <MeetupSponsors>();

            string jsonResponse = null;

            try
            {
                jsonResponse = ONETUGRequest.GetResponse(_groupInfoUrl);
            }
            catch (System.Net.WebException)
            {
                throw new InvalidOperationException("Error retrieving sponsor data.");
            }

            dynamic d = JObject.Parse(jsonResponse);

            if (d.results.Count > 0)
            {
                foreach (var sponsorJSON in d.results[0].sponsors)
                {
                    sponsors.Add(new MeetupSponsors {
                        Name = sponsorJSON.name, CompanyUrl = sponsorJSON.url, ImageUrl = sponsorJSON.image_url, Details = sponsorJSON.details, Info = sponsorJSON.info
                    });
                }
            }
            return(sponsors);
        }
예제 #2
0
        public MeetupGroup()
        {
            string  jsonResponse = ONETUGRequest.GetResponse(_groupInfoUrl);
            dynamic d            = JObject.Parse(jsonResponse);

            this.GroupUrl    = string.Format("http://www.meetup.com/{0}/", GroupSettings.Instance.MeetupGroupName);
            this.ImageUrl    = "~/Images/bacon.jpeg";
            this.Description = "<p>Join us for one of our regular Nerd Dinners. These are events are simply social and have no planned agenda. We typically meet at the Mall at Millenia food court at the base of the ramp that leads to the center lounge area. Grab some food from one of the many vendors in the food court area and enjoy some good conversation and networking.</p> <p>Naturally there will be .NET developers there but we welcome developers and IT professionals from all disciplines. The more diversity, the better the conversation. :-)</p>";
            this.Name        = string.Format("{0} - {1}", GroupSettings.Instance.Name, GroupSettings.Instance.Title);
            if (d.results.Count > 0)
            {
                this.GroupUrl    = d.results[0].link;
                this.ImageUrl    = d.results[0].group_photo.photo_link;
                this.Description = d.results[0].description;
                this.Name        = d.results[0].name;
            }
        }
예제 #3
0
        public static List <Meeting> GetUpcomingMeetings()
        {
            List <Meeting> meetings     = new List <Meeting>();
            string         jsonResponse = ONETUGRequest.GetResponse(_eventURL);
            dynamic        d            = JObject.Parse(jsonResponse);

            foreach (var result in d.results)
            {
                Meeting meeting = new Meeting {
                    VenueName       = result.venue.name,
                    VenueAddress    = string.Format("{0} {1} {2} {3}", result.venue.address_1, result.venue.city, result.venue.state, result.venue.zip),
                    NumberRSVPedYes = result.yes_rsvp_count,
                    MeetingTime     = GetMeetingTime(
                        Int64.Parse(result.utc_offset.ToString()),
                        Int64.Parse(result.duration == null ? "7200000" : result.duration.ToString()),
                        Int64.Parse(result.time.ToString())),
                    MeetingDescriptionHTML = result.description,
                    Name = result.name,
                    Url  = result.event_url
                };
                meetings.Add(meeting);
            }
            return(meetings);
        }