Ejemplo n.º 1
0
        public ActionResult NhlGamesRtss()
        {
            Dictionary <string, Exception> results = new Dictionary <string, Exception>();

            if (this.IsKeyValid())
            {
                results.Add("NhlGamesRtss", this.Update(delegate() { SportsData.Nhl.NhlGamesRtss.GetNewResultsOnly(saveToDb: true); }));
                results.Add("HtmlBlob", this.Update(delegate() { HtmlBlob.UpdateSeason(forceOverwrite: false); }));
            }

            return(Json(results, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public void NhlHtmlReport_HtmlBlobTest()
        {
            Uri url = new Uri("http://www.nhl.com/scores/htmlreports/20132014/RO020507.HTM ");
            //Uri url = new Uri("http://www.nhl.com/scores/htmlreports/20132014/RO020502.HTM");

            string id     = (new Guid()).ToString();
            string result = HtmlBlob.GetHtmlPage(url);

            Assert.IsFalse(HtmlBlob.BlobExists(HtmlBlobType.NhlRoster, id, url));

            HtmlBlob.SaveBlob(HtmlBlobType.NhlRoster, id, url, result);
            string downloadedBlob = HtmlBlob.RetrieveBlob(HtmlBlobType.NhlRoster, id, url);

            Assert.IsTrue(HtmlBlob.BlobExists(HtmlBlobType.NhlRoster, id, url));
        }
Ejemplo n.º 3
0
        public void HtmlBlob_Test()
        {
            List <Nhl_Games_Rtss> models;

            using (SportsDataContext db = new SportsDataContext())
            {
                models = (from m in db.Nhl_Games_Rtss_DbSet
                          where
                          (m.Home == "VANCOUVER" || m.Visitor == "VANCOUVER") &&
                          m.Date >= new DateTime(2014, 1, 29)
                          select m).ToList();
            }

            Dictionary <Uri, string> items = new Dictionary <Uri, string>();

            models.ForEach(m => items.Add(new Uri(m.RosterLink), m.Id.ToString()));
            HtmlBlob.GetAndStoreHtmlBlobs(HtmlBlobType.NhlRoster, items, false);

            foreach (Nhl_Games_Rtss model in models)
            {
                string html = HtmlBlob.RetrieveBlob(HtmlBlobType.NhlRoster, model.Id.ToString(), new Uri(model.RosterLink), true);
            }
        }
Ejemplo n.º 4
0
 public void Script_HtmlBlobs_Roster()
 {
     HtmlBlob.UpdateSeason();
 }