コード例 #1
0
ファイル: Wall.cs プロジェクト: KadyrkeshSultan/KeepLife
 public Wall(VkApi app, string domain)
 {
     this.app = app;
     wall     = app.Wall.Get(new VkNet.Model.RequestParams.WallGetParams
     {
         Domain   = domain,
         Count    = 99,
         Extended = true,
         Filter   = WallFilter.Owner
     });
 }
コード例 #2
0
ファイル: Wall.cs プロジェクト: KadyrkeshSultan/KeepLife
 public Wall(VkApi app, long?ID)
 {
     this.app = app;
     wall     = app.Wall.Get(new VkNet.Model.RequestParams.WallGetParams
     {
         OwnerId  = ID,
         Count    = 5,
         Extended = true,
         Filter   = WallFilter.Owner
     });
 }
コード例 #3
0
        public IEnumerable <Post> GetPosts()
        {
            WallGetParams parametrs = new WallGetParams
            {
                OwnerId = -72869598
            };

            try
            {
                VkNet.Model.WallGetObject posts = new VkNet.Model.WallGetObject();
                parametrs.Count = api.Wall.Get(parametrs).TotalCount - db.Count.TotalCount;
                if (parametrs.Count > 0)
                {
                    posts    = api.Wall.Get(parametrs);
                    db.Count = new TotalCountPosts {
                        Id           = 0
                        , TotalCount = db.Count.TotalCount + parametrs.Count
                    };
                }
                if (posts.WallPosts.Count != 0)
                {
                    foreach (var el in posts.WallPosts)
                    {
                        Post post = new Post
                        {
                            Id              = el.Id,
                            Date            = el.Date,
                            Message         = el.Text,
                            LastConfirmDate = el.Date
                        };
                        if (!db.GetAll().Where(x => x.Date == x.Date).Where(x => x.Message.Equals(post.Message)).Any())
                        {
                            System.Console.WriteLine(post.Message);
                            db.Add(post);
                        }
                    }
                }
                return(db.Get());
            }
            catch
            {
                return(db.Get());
            }
        }