Exemple #1
0
        public void Scrape(ScrapeDetails detail)
        {
            Log.Information("Scraping started");
            if (detail.type == Miscellaneous.Type.TYPE_INSTAGRAM_FOLLOWERS)
            {
                Log.Information("Scraping instagram user followers -- Started");
                user          = new UserSessionData();
                user.UserName = detail.userName;
                user.Password = detail.password;

                Login(detail.url);
            }
            else if (detail.type == Miscellaneous.Type.TYPE_TWITTER_KEYWORD)
            {
                Log.Information("Scraping twitter by keywords -- Started");
                ScrapeTwitter(detail.url);
            }
            else if (detail.type == Miscellaneous.Type.TYPE_YELP)
            {
                Log.Information("Scraping YELP by keywords -- Started");
                // Scrape the yelp buisness directory
                ScrapeYelp(detail.url, detail.location);
            }
            else if (detail.type == Miscellaneous.Type.TYPE_GOOGLE)
            {
                Log.Information("Scraping GOOGLE by keywords -- Started");
                ScrapeGoogle(detail.url);
            }
            else if (detail.type == Miscellaneous.Type.TYPE_INSTAGRAM_HASHTAG_FOLLOWERS)
            {
            }
            else if (detail.type == Miscellaneous.Type.TYPE_FACEBOOK_GROUP_FOLLOWERS)
            {
            }
        }
        private void AddButtonHandler(object sender, RoutedEventArgs e)
        {
            // Code behind to add event handler
            if ((cboType.SelectedIndex == 5 || cboType.SelectedIndex == 4 || cboType.SelectedIndex == 6) && string.IsNullOrEmpty(url.Text))
            {
                return;
            }
            else if ((cboType.SelectedIndex == 0 || cboType.SelectedIndex == 1) && (string.IsNullOrEmpty(url.Text) || string.IsNullOrEmpty(username.Text) || string.IsNullOrEmpty(password.Text)))
            {
                return;
            }

            int index = cboType.SelectedIndex;

            ScrapeDetails details = new ScrapeDetails((Miscellaneous.Type)index, url.Text, username.Text, password.Text, location.Text);

            scrapeList.Add(details);
            Console.Text += "Scrape " + comboBoxItemMap[index] + "\n";
        }