C# How to post Blogger Article using API?

SNOOP TV <[email protected]>
Newsgroups gmane.comp.web.blogger.api
Message-ID <[email protected]>



<https://lh3.googleusercontent.com/-kI3ReM9umQQ/VchiNJgBvnI/AAAAAAAAAHA/EvDsE4Wxtsg/s1600/z1.PNG>
I can't know this code's error

<sourcecode>
            CheckForIllegalCrossThreadCalls = false;
            Service service = new Service("blogger", "*<googleAPIprojectID>*
");
            service.Credentials = new GDataCredentials(username, password);
            GDataGAuthRequestFactory factory = 
(GDataGAuthRequestFactory)service.RequestFactory;
            factory.AccountType = "GOOGLE";
            /////////////////////////////////////////////////////////////

            ///////post////////////////////////////////
            AtomEntry post = new AtomEntry();
            post.Title.Text = title;
            post.Content = new AtomContent();
            post.Content.Content = postBody;
            post.Content.Type = "xhtml";
            int length = 0;
            //make sure that tags are not too long
            string[] tagsS = tags.Split(',');
            foreach (string label in tagsS)
            {
                length = length + label.Count();
                if (length > 198)
                {
                    string label2 = label.Substring(0, 199);
                    AtomCategory cat = new AtomCategory();
                    cat.Scheme = new Uri("http://www.blogger.com/atom/ns#");
                    cat.Term = label2;
                    post.Categories.Add(cat);
                    this.maskedTextBox5.Text = this.maskedTextBox5.Text + 
label2 + ",";
                    break;
                }
                else
                {
                    AtomCategory cat = new AtomCategory();
                    cat.Scheme = new Uri("http://www.blogger.com/atom/ns#");
                    cat.Term = label;
                    post.Categories.Add(cat);
                }
            }
            post.IsDraft = false;

            ///////////////publishing post/_/_/_/_/_/_\_|_/_)_(_--> () - {} 
- [] 0_o
            Uri blogFeedUri = new Uri("*http://www.blogger.com/feeds/" + 
blogId + "/posts/default*");
            AtomEntry createdEntry = null;
            try
            {
                createdEntry = service.Insert(blogFeedUri, post);
                MessageBox.Show("Done!");
            }
            catch (GDataRequestException exception)
            {
                if (exception.ResponseString == "Blog has exceeded rate 
limit or otherwise requires word verification for new posts")
                    MessageBox.Show("Blog has exceeded rate limit or 
otherwise requires word verification for new posts");
            }
            if (createdEntry == null)
                MessageBox.Show("Something went wrong, atricle was not 
published...\nCheck all html tags...");        
</sourcecode>

-- 
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.