StaticWriter.Services.Blogger.Post[] IBlogger.blogger_getRecentPosts(string appKey, string blogid, string username, string password, int numberOfPosts) { List<StaticWriter.Services.Blogger.Post> posts = new List<StaticWriter.Services.Blogger.Post>(); foreach (MetaWeblog.Post mwPost in mwPosts) { StaticWriter.Services.Blogger.Post post = new StaticWriter.Services.Blogger.Post(); post.content = mwPost.description; post.dateCreated = mwPost.dateCreated; post.postid = mwPost.postid; posts.Add(post); } return posts.ToArray(); }
StaticWriter.Services.Blogger.Post IBlogger.blogger_getPost(string appKey, string postid, string username, string password) { int postNum; if (int.TryParse(postid, out postNum) && postNum > 0 && postNum <= mwPosts.Count ) { StaticWriter.Services.Blogger.Post post = new StaticWriter.Services.Blogger.Post(); post.content = mwPosts[postNum-1].description; post.dateCreated = mwPosts[postNum-1].dateCreated; post.postid = mwPosts[postNum-1].postid; return post; } return null; }