public static void Send() { try { var dicInvestments = InvestmentStream.GetNewFundInvestment(); if (dicInvestments.Count > 0) { List <string> descriptions = new List <string>(); foreach (var fund in dicInvestments) { foreach (var investment in fund.Value) { descriptions.Add(investment.Description); } } string info = string.Join("<br />", descriptions); DailyReport.Send(info); ExecutionUpdater.UpdateCrmSent(); Log.Info("CrmReport.Send", "Updates sent by email"); } else { Log.Info("CrmReport.Send", "No update"); } } catch (Exception ex) { Log.Error("CrmReport.Send", "error", ex); } }
private void TimerAngelList_Elapsed(object sender, ElapsedEventArgs e) { if (!_isRunning) { _isRunning = true; try { Log.Info("AngelList_feed", "update mongo with last investments feeds"); InvestmentStream.GetInvestmentsFromFeed(); Log.Info("AngelList_feed", "update mongo with last incubations feeds"); IncubationStream.GetIncubationsFromFeed(); } catch (Exception ex) { LogEventLog(ex.Message); } finally { _isRunning = false; } } else { Log.Info("ProcessFiles", "Tried to start a new processing, but a process is still in progress"); } }
//public ActionResult TestRssFeed() //{ // var items = new List<SyndicationItem>(); // for (int i = 0; i < 20; i++) // { // var item = new SyndicationItem() // { // Id = Guid.NewGuid().ToString(), // Title = SyndicationContent.CreatePlaintextContent(String.Format("My Title {0}", Guid.NewGuid())), // Content = SyndicationContent.CreateHtmlContent("Content The stuff."), // PublishDate = DateTime.Now // }; // item.Links.Add(SyndicationLink.CreateAlternateLink(new Uri("http://www.google.com")));//Nothing alternate about it. It is the MAIN link for the item. // items.Add(item); // } // return new RssFeed(title: "Test rss", // items: items, // contentType: "application/rss+xml", // description: String.Format("rss de test {0}", Guid.NewGuid())); //} public ActionResult RssFeed() { var fundInvestments = InvestmentStream.GetNewFundInvestmentList(); var news = new List <SyndicationItem>(); foreach (var fundInvestment in fundInvestments) { foreach (var investment in fundInvestment.Investments) { SyndicationItem newInvestment = new SyndicationItem() { Title = SyndicationContent.CreatePlaintextContent(string.Format("{0} {1} {2}", fundInvestment.Fund.Name, Constants.INVEST_IN, investment.Startup.Name)), Content = SyndicationContent.CreateHtmlContent(investment.Description), PublishDate = DateTime.Parse(investment.DateActivityFeed), }; newInvestment.Links.Add(SyndicationLink.CreateAlternateLink(new Uri(investment.Startup.Url))); news.Add(newInvestment); } } var fundIncubations = IncubationStream.GetNewFundIncubationList(); foreach (var fundIncubation in fundIncubations) { foreach (var incubation in fundIncubation.Incubations) { SyndicationItem newInvestment = new SyndicationItem() { Title = SyndicationContent.CreatePlaintextContent(string.Format("{0} {1} {2}", fundIncubation.Fund.Name, Constants.INCUBATE, incubation.Startup.Name)), PublishDate = DateTime.Parse(incubation.DateActivityFeed), }; newInvestment.Links.Add(SyndicationLink.CreateAlternateLink(new Uri(incubation.Startup.Url))); news.Add(newInvestment); } } ExecutionUpdater.UpdateRss(); Log.Info("RssFeed", "refresh new feeds"); return(new RssFeed(title: "Angel list feed", items: news, contentType: "application/rss+xml", description: String.Format("Thibaut Cantet Angel list {0}", Guid.NewGuid()))); }
static void Main(string[] args) { TimeSpan t; bool success = TimeSpan.TryParse("2013-08-21T01:09:48Z", out t); DateTime d; success = DateTime.TryParse("2013-08-21T01:09:48Z", out d); //var res = StartupStream.GetStartups(); var dic = StartupRoleStream.GetStartupRoles(); InvestmentStream.GetHistory(); // InvestmentStream.CorrectFundInvestments(); // CrmReport.Send(); InvestmentStream.GetInvestmentsFromFeed(); IncubationStream.GetIncubationsFromFeed(); //Console.Write(res); }