Пример #1
0
        public ActionResult Index(FormCollection fc, string submitButton)
        {
            Session["tweet"] = Request["tweet"];

            if (submitButton == "tweet")
            {
                return RedirectToAction("Index", "Twitter");
            }
            string t = Request["tweet"];
            Twitter tw = new Twitter();
            tw.Tweet = t;

            List<string> ls = tw.hashtags();
            ViewBag.tweet = t;
            ViewBag.tags = ls;
            return View(tw);
        }
Пример #2
0
        public static string UrlConcepts(string tweet)
        {
            List<ConceptWeight> lc = new List<ConceptWeight>();
            Twitter t = new Twitter();
            foreach (string url in t.geturls(tweet))
            {
                XDocument xd;
                HttpWebRequest request = WebRequest.Create("http://api.semantichacker.com/rjx6di49/concept?uri=" + url) as HttpWebRequest;
                // Get response
                using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
                {
                    // Get the response stream
                    StreamReader reader = new StreamReader(response.GetResponseStream());
                    xd = XDocument.Parse(reader.ReadToEnd().ToString());
                }
                lc.AddRange(ListConcepts(xd));

            }
            return TopConcepts(lc);
        }