コード例 #1
0
        public MoveableType.PostTitle[] mt_getRecentPostTitles(string blogid, string username, string password, int numberOfPosts)
        {
            if (!dasBlogSettings.SiteConfiguration.EnableBloggerApi)
            {
                throw new ServiceDisabledException();
            }

            if (!VerifyLogin(username, password))
            {
                throw new SecurityException();
            }

            var entries = dataService.GetEntriesForDay(DateTime.Now.ToUniversalTime(), dasBlogSettings.GetConfiguredTimeZone(), null,
                                                       dasBlogSettings.SiteConfiguration.RssDayCount, numberOfPosts, null);
            var arrayList = new List <MoveableType.PostTitle>();

            foreach (Entry entry in entries)
            {
                var post = new MoveableType.PostTitle();
                post.title       = NoNull(entry.Title);
                post.dateCreated = entry.CreatedUtc;
                post.postid      = NoNull(entry.EntryId);
                post.userid      = username;
                arrayList.Add(post);
            }
            return(arrayList.ToArray());
        }
コード例 #2
0
        public MoveableType.PostTitle[] mt_getRecentPostTitles(string blogid, string username, string password, int numberOfPosts)
        {
            VerifyAccess(username, password);

            var entries = dataService.GetEntriesForDay(DateTime.Now.ToUniversalTime(), dasBlogSettings.GetConfiguredTimeZone(), null,
                                                       numberOfPosts, numberOfPosts, null);
            var arrayList = new List <MoveableType.PostTitle>();

            foreach (Entry entry in entries)
            {
                var post = new MoveableType.PostTitle();
                post.title       = NoNull(entry.Title);
                post.dateCreated = entry.CreatedUtc;
                post.postid      = NoNull(entry.EntryId);
                post.userid      = username;
                arrayList.Add(post);
            }
            return(arrayList.ToArray());
        }