Esempio n. 1
0
        public static void getStatusPictures(Status status, String path)
        {
            string s = null;
            if (status != null)
            {
                s = status.OriginalPictureUrl;
                if (!string.IsNullOrEmpty(s))
                {
                    string[] ss = s.Split('/');
                    string picPath = path + "o_" + ss[ss.Length - 1];
                    if (!File.Exists(picPath))
                    {
                        Downloader.getPicture(s, picPath);
                    }
                }

                s = status.MiddleSizePictureUrl;
                if (!string.IsNullOrEmpty(s))
                {
                    string[] ss = s.Split('/');
                    string picPath = path + "m_" + ss[ss.Length - 1];

                    if (!File.Exists(picPath))
                    {
                        Downloader.getPicture(s, picPath);
                    }
                }
            }
        }
Esempio n. 2
0
        public List<Status> getUserStatusByHome(int num = 50, int page = 1)
        {
            num = Math.Min(num, 200);
            List<Status> myStatusList = new List<Status>();

            try
            {
                var statusList = sina.API.Entity.Statuses.HomeTimeline(null, null, num, page, false, 0);

                if (statusList.Statuses != null)
                {
                    foreach (var statusInfo in statusList.Statuses)
                    {
                        Status status = new Status(statusInfo);
                        myStatusList.Add(status);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}", ex.GetType().Name);
                Console.WriteLine("{0}", ex.Message);
            }

            return myStatusList;
        }
Esempio n. 3
0
        public List<Status> getUserStatusByUserName(string userName, int num = 50, int page = 1)
        {
            Console.WriteLine("Start crawling : " + userName);
            List<Status> myStatusList = new List<Status>();

            try
            {
                var statusList = sina.API.Entity.Statuses.UserTimeline(null, userName, "0", "0", num, page, false, 0, false);

                if (statusList.Statuses != null)
                {
                    foreach (var statusInfo in statusList.Statuses)
                    {
                        Status status = new Status(statusInfo);
                        myStatusList.Add(status);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}", ex.GetType().Name);
                Console.WriteLine("{0}", ex.Message);
            }

            return myStatusList;
        }
Esempio n. 4
0
        private bool refreshNextStatus()
        {
            // 找到下一个符合过滤需求的Status
            status = (Status)statusSerializer.ReadNextObject();
            if (status == null) return false;

            // 找到了就显示出来等代标记
            txbStatusContent.Text = "Status ID:";
            txbStatusContent.Text += status.UserID;
            txbStatusContent.Text += "\r\n";
            txbStatusContent.Text += status.Text;

            return true;
        }