Exemplo n.º 1
0
 private static string Login(ref Scraper.Scraper scraper, string username, string password)
 {
     var lastContent = scraper.PerformRequest(Constants.RunkeeperConstants.URL_START);
     var postdata = "_eventName=submit&email=" + username + "&password=" + password;
     lastContent = scraper.PerformRequest(Constants.RunkeeperConstants.URL_LOGIN, postdata);
     return lastContent;
 }
Exemplo n.º 2
0
 private static string GetPeriodData(ref Scraper.Scraper scraper, string userName, string period)
 {
     var url = String.Format("http://runkeeper.com/activitiesByDateRange?userName={0}&userName={0}&startDate={1}", userName, period);
     //var url = "http://runkeeper.com/activitiesByDateRange?userName="******"&startDate=" + period;
     var lastContent = scraper.PerformRequest(url, null);
     return lastContent;
 }
Exemplo n.º 3
0
        private void Scrape_Click(object sender, EventArgs e)
        {
            var url = urlBox.Text;

            AddLog(string.Format("Scrapes url:'{0}'", url));
            var scraper = new Scraper();
            var lastContent = scraper.PerformRequest(url);
            AddLog(string.Format("Scraped:'{0}', got:",url));
            AddLog(lastContent);
        }
Exemplo n.º 4
0
        private void runkeeperTest_Click(object sender, EventArgs e)
        {
            var scraper = new Scraper();

            var urlStart = "https://runkeeper.com";
            AddLog(string.Format("Scrapes url:'{0}'", urlStart));
            var lastContent = scraper.PerformRequest(urlStart);
            AddLog(string.Format("Scraped:'{0}', got:", urlStart));
            AddLog(lastContent);

            var urlLogin = "******";
            AddLog(string.Format("Scrapes url:'{0}'", urlLogin));
            var postdata = "_eventName=submit&email=" + userNameBox.Text + "&password="******"Scraped:'{0}', got:", urlLogin));
            AddLog(lastContent);

            var urlInloggad = "http://runkeeper.com/home";
            AddLog(string.Format("Scrapes url:'{0}'", urlInloggad));
            lastContent = scraper.PerformRequest(urlInloggad, null);
            AddLog(string.Format("Scraped:'{0}', got:", urlInloggad));
            AddLog(lastContent);
        }
Exemplo n.º 5
0
 private static string EnterHome(ref Scraper.Scraper scraper)
 {
     var lastContent = scraper.PerformRequest(Constants.RunkeeperConstants.URL_HOME, null);
     return lastContent;
 }