예제 #1
0
 public AppsWorldVisitorsParser(IEnumerable<Cookie> cookies, string referer)
 {
     var cookieContainer = new CookieContainer();
     cookies.Each(c => {
         cookieContainer.Add(c);
     });
     _webRequestHelper = new WebRequestHelper(null, cookieContainer) {
         MinRequestDelay = TimeSpan.FromSeconds(5)
     };
     _webRequestHelper.SetParam(WebRequestParamType.UserAgentString, new WebRequestParamString(referer));
     _webRequestHelper.SetParam(WebRequestParamType.AcceptString, new WebRequestParamString("application/json,application/javascript"));
     _webRequestHelper.SetParam(WebRequestParamType.ContentTypeString, new WebRequestParamString("application/json; charset=utf-8"));
     _webRequestHelper.SetParam(WebRequestParamType.HeadersArrayKeyValue,
         new WebRequestParamWebHeaderCollection(new WebHeaderCollection {
         })
     );
 }