Exemplo n.º 1
0
 public ActionResult Index(String query)
 {
     if (!String.IsNullOrEmpty(query))
     {
         ViewBag.Query = query;
         IMDBBridge imdb = new IMDBBridge();
         IEnumerable<IMDBTitle> titles = imdb.SearchTitles(query);
         return View(titles);
     }
     return View();
 }
Exemplo n.º 2
0
        public ActionResult Reviews(String titleID, int page = 0)
        {
            ViewBag.ClassifierType = ClassifierType.ToString();
            if (!String.IsNullOrEmpty(titleID))
            {
                IMDBBridge imdb = new IMDBBridge();
                ISentimentClassifier sentimentClassifier = GetClassifier(ClassifierType);
                int total = 0;

                String title;
                IEnumerable<IMDBReview> reviews = imdb.GetReviews(titleID, page, PageSize, out total, out title);

                sentimentClassifier.Classify(reviews);
                ViewBag.TitleName = title;
                ViewBag.TitleID = titleID;
                ViewBag.Page = page;
                ViewBag.TotalReviews = total;
                ViewBag.TotalPages = Convert.ToInt32(Math.Ceiling(total * 1.0 / PageSize));
                return View(reviews);
            }
            return View();
        }