public void SendTweetsForMeetings(TimeSpan waitTime) { var meetings = _meetingsRepository.GetUpcommingMeetings(); foreach (var meeting in meetings) { // We will wait for 1 hour before sending tweets if (DateTime.Now - meeting.CreatedAt < waitTime) { continue; } if (!DataContext.Current.MeetingTweetAlerts.Any(x => x.MeetingId == meeting.Id)) { var alert = new MeetingTweetAlert(); alert.Message = _twitterMeetingAlertGenerator.GenerateMessage(meeting); alert.DateSent = DateTime.Now; alert.MeetingId = meeting.Id; try { _twitterAdapter.SendTweet(alert.Message); } catch (Exception ex) { alert.DateFailed = DateTime.Now; alert.FailMessage = ex.Message; Debug.WriteLine("Could not send twitter message for meeting {0}: {1}", meeting.Id, ex.Message); } DataContext.Current.MeetingTweetAlerts.Add(alert); } } }
public ActionResult MeetingsForFrontpage() { var upcommingMeetings = MeetingsRepository.GetUpcommingMeetings(Request.QueryString).ToArray(); //ViewBag.MapData = MeetingsMapHelper.CreateMeetingMapModel(upcommingMeetings, Url); return(PartialView(upcommingMeetings)); }
public ActionResult Index() { ViewBag.MetaDescription = "Geekhub.dk er stedet hvor udviklere finder deres events/arrangementer - foreslÄ dit event til listen, og spred budskabet."; var upcommingMeetings = MeetingsRepository.GetUpcommingMeetings(Request.QueryString); return(View(upcommingMeetings)); }
public ActionResult Widget() { var title = Request.QueryString["title"].Or("Udvikler events i danmark"); var meetings = MeetingsRepository.GetUpcommingMeetings(Request.QueryString); var model = new WidgetViewModel(title, meetings.Take(5)); return(PartialView(model)); }
public ActionResult Json() { var model = MeetingsRepository.GetUpcommingMeetings(Request.QueryString); var options = new JsonSerializerSettings(); options.ContractResolver = new CamelCasePropertyNamesContractResolver(); var json = JsonConvert.SerializeObject(new JsonViewModel(model), options); return(Content(json, "application/json")); }
public ActionResult Ics() { var meetings = MeetingsRepository.GetUpcommingMeetings(Request.QueryString); return(new CalendarResult("Geekhub", meetings)); }
public ActionResult Rss() { var model = MeetingsRepository.GetUpcommingMeetings(Request.QueryString); return(PartialView(new RssViewModel(model))); }