Пример #1
0
        newtelligence.DasBlog.Web.Services.MovableType.PostTitle[] IMovableType.mt_getRecentPostTitles(string blogid, string username, string password, int numberOfPosts)
        {
            if (!siteConfig.EnableBloggerApi)
            {
                throw new ServiceDisabledException();
            }
            UserToken token = SiteSecurity.Login(username, password);

            if (token == null)
            {
                throw new System.Security.SecurityException();
            }
            EntryCollection entries = dataService.GetEntriesForDay(DateTime.Now.ToUniversalTime(), new Util.UTCTimeZone(), null, SiteConfig.GetSiteConfig().RssDayCount, numberOfPosts, null);
            List <newtelligence.DasBlog.Web.Services.MovableType.PostTitle> arrayList = new List <newtelligence.DasBlog.Web.Services.MovableType.PostTitle>();

            foreach (Entry entry in entries)
            {
                newtelligence.DasBlog.Web.Services.MovableType.PostTitle post = new newtelligence.DasBlog.Web.Services.MovableType.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
        MovableType.PostTitle[] MovableType.IMovableType.mt_getRecentPostTitles(string blogid, string username, string password, int numberOfPosts)
        {
            if (!_dasBlogSettings.SiteConfiguration.EnableBloggerApi)
            {
                throw new ServiceDisabledException();
            }
            UserToken token = SiteSecurity.Login(username, password);

            if (token == null)
            {
                throw new System.Security.SecurityException();
            }
            EntryCollection entries = _dataService.GetEntriesForDay(DateTime.Now.ToUniversalTime(), TimeZone.CurrentTimeZone, null,
                                                                    _dasBlogSettings.SiteConfiguration.RssDayCount, numberOfPosts, null);
            List <MovableType.PostTitle> arrayList = new List <MovableType.PostTitle>();

            foreach (Entry entry in entries)
            {
                MovableType.PostTitle post = new MovableType.PostTitle();
                post.title       = noNull(entry.Title);
                post.dateCreated = entry.CreatedUtc;
                post.postid      = noNull(entry.EntryId);
                post.userid      = username;
                arrayList.Add(post);
            }
            return(arrayList.ToArray());
        }
Пример #3
0
 newtelligence.DasBlog.Web.Services.MovableType.PostTitle[] IMovableType.mt_getRecentPostTitles(string blogid, string username, string password, int numberOfPosts)
 {
     if ( !siteConfig.EnableBloggerApi )
     {
         throw new ServiceDisabledException();
     }
     UserToken token = SiteSecurity.Login(username, password);
     if (token == null)
     {
         throw new System.Security.SecurityException();
     }
     EntryCollection entries = dataService.GetEntriesForDay( DateTime.Now.ToUniversalTime(), new Util.UTCTimeZone(), null, SiteConfig.GetSiteConfig().RssDayCount, numberOfPosts, null );
     ArrayList arrayList = new ArrayList();
     foreach (Entry entry in entries)
     {
         newtelligence.DasBlog.Web.Services.MovableType.PostTitle post = new newtelligence.DasBlog.Web.Services.MovableType.PostTitle();
         post.title = noNull(entry.Title);
         post.dateCreated=entry.CreatedUtc;
         post.postid=noNull(entry.EntryId);
         post.userid=username;
         arrayList.Add( post );
     }
     return arrayList.ToArray(typeof(newtelligence.DasBlog.Web.Services.MovableType.PostTitle)) as newtelligence.DasBlog.Web.Services.MovableType.PostTitle[];
 }