示例#1
0
        protected void GetPage(int ts)
        {
            this._ts = ts;
            if (this._token == null)
            {
                this.GetToken();
                return;
            }
            if (this._username == null)
            {
                this._username = this.getURL(this.w.Url);
            }
            string str = string.Concat(new object[] { "https://api.500px.com/v1/activities/", this._username, "?rpp=", ts, "&to=", this._lastDate, "&items_max=10&authenticity_token=", this._token });
            int    num = this._currPage + 1;

            this._currPage    = num;
            this.w.Viewstatus = string.Concat("Parsing page ", num);
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.GetPageCallback);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
示例#2
0
 public void AddFile(PostItem p, string url, string filename, Downloader.Callback <PostItem> callback)
 {
     lock (this.Files)
     {
         DownloadState downloadState = new DownloadState(Downloader.DownloadType.File, p, url, filename, null, callback);
         this.Files.Enqueue(downloadState, 5);
     }
     this.StartDownload();
 }
示例#3
0
 public DownloadState(Downloader.DownloadType ty, PostItem p, string u, string f, WebClient c, Downloader.Callback <PostItem> call)
 {
     this.type     = ty;
     this.Uri      = new System.Uri(u);
     this.Url      = u;
     this.Filename = f;
     this.Client   = c;
     this.postItem = p;
     this.callback = call;
 }
示例#4
0
        private void getChannel(string url)
        {
            this.w.Viewstatus = "Getting ChannelID ";
            Post post = new Post()
            {
                Url     = url,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.CallbackChannelID);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
示例#5
0
        private void GetToken()
        {
            string str = string.Concat("http://", this.w.Url, "/flow");

            this.w.Viewstatus = "Getting token ";
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.GetPageCallbackToken);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
示例#6
0
        protected void GetPage(int ts)
        {
            this._ts = ts;
            string str = string.Concat(new object[] { "http://", this.w.Url, "/?data=1&page=", ts });

            this.w.Viewstatus = string.Concat("Parsing page ", ts);
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.GetPageCallback);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
示例#7
0
        public void DownloadPostHTML(Post post, Downloader.Callback <PostItem> callback)
        {
            int num = 3;

            if (post.Name == null)
            {
                num = 1;
            }
            PostItemHtml  postItemHtml  = new PostItemHtml(post, post.Url);
            DownloadState downloadState = new DownloadState(Downloader.DownloadType.String, postItemHtml, post.Url, null, null, callback);

            lock (this.Files)
            {
                this.Files.Enqueue(downloadState, num);
            }
            this.StartDownload();
        }
示例#8
0
        protected void GetPage(int page)
        {
            if (this._channelID == null)
            {
                this.getChannel(string.Concat("http://", this.w.Url));
                return;
            }
            this._currPage = page;
            string str = string.Concat(new object[] { "http://www.youtube.com/c4_browse_ajax?action_load_more_videos=1&paging=", page, "&sort=dd&live_view=500&flow=grid&view=0&channel_id=", this._channelID, "&fluid=True" });

            this.w.Viewstatus = string.Concat("Parsing page ", this._currPage);
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.GetPageCallback);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
示例#9
0
        protected void GetPage(int offset)
        {
            this.currentCount = offset;
            string      str         = string.Concat("http://", this.w.Url);
            MyWebClient myWebClient = new MyWebClient();

            if (offset > 0)
            {
                str = string.Concat(str, "?before=", offset);
            }
            this.w.Viewstatus = string.Concat("Loading page ", offset);
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.getPageCallback);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
示例#10
0
        protected void GetPage(string ts)
        {
            string str = string.Concat("http://", this.w.Url, "/media");

            if (ts != "0")
            {
                str = string.Concat(str, "?max_id=", ts);
            }
            int num = this._currPage + 1;

            this._currPage    = num;
            this.w.Viewstatus = string.Concat("Parsing page ", num);
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.GetPageCallback);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
示例#11
0
        protected void GetPage(int page)
        {
            if (page == 0)
            {
                page = 1;
            }
            Console.WriteLine(string.Concat("GetPage ", page));
            this.currentPage = page;
            string str = string.Concat("http://", this.w.Url);

            if (page > 1)
            {
                str = string.Concat(str, "/page/", page);
            }
            this.w.Viewstatus = string.Concat("Parsing page ", page);
            Post post = new Post()
            {
                Url     = str,
                Website = this.w
            };

            Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.getPageCallback);
            Downloader.GetInstance().DownloadPostHTML(post, callback);
        }
示例#12
0
 private void processPost(Post post)
 {
     Downloader.Callback <PostItem> callback = new Downloader.Callback <PostItem>(this.processPostCallback);
     Downloader.GetInstance().DownloadPostHTML(post, callback);
 }