protected virtual IEnumerable <IFacebookEvent> GetBasicEventData(string url) { var eventsDocument = GetFacebookMobilePageDocument(url); var eventIds = eventsDocument .Descendants("article") .Select(article => new { Id = article.TryGetAttributeValue("id"), Element = article }) .Where(div => div.Id != string.Empty) .Select(div => { var result = new FacebookEvent(this, div.Id); var titleDiv = div .Element .Descendants("div") .Where(div2 => div2.TryGetAttributeValue("class").StartsWith("title")) .FirstOrDefault(); if (titleDiv != null) { result.Title = titleDiv.Value; } return(result); }); return(eventIds); }
/// <summary> /// Creates an event-Object with the given id. /// </summary> /// <param name="id">Id of the facebook event.</param> /// <returns>A newly created event object with the given id.</returns> public IFacebookEvent GetEvent(string id) { var result = new FacebookEvent(this, id); return(result); }