Blogger Api Kullanan Var Mı ?
-
gdata.client ve gdata.blogger apisi kullanıyorum.
yeni post atmaya calısıyorum. aldığım hata :
Execution of request failed:
1 tane post atabildim. bir dahada atamadım. bunun için önerdiğiniz class vs varsa oada bakabilirim.
public static bool AddPost(string title, string bodyHTML, string[] labels)
{
Service service = new Service("blogger","xxxx");
service.Credentials = new GDataCredentials("xxxxx", "xxxxxxx");
AtomEntry newPost = new AtomEntry();
newPost.Title.Text = title;
newPost.Content = new AtomContent();
newPost.Content.Content = bodyHTML;
newPost.Content.Type = "html";
foreach (string label in labels)
{
AtomCategory cat = new AtomCategory();
cat.Scheme = new Uri("http://www.blogger.com/atom/ns#");
cat.Term = label;
newPost.Categories.Add(cat);
}
AtomEntry response = null;
try
{
response = service.Insert(new Uri("xxxxxxxxxx"), newPost);
}
catch (GDataRequestException exception)
{
if (exception.ResponseString == "Blog has exceeded rate limit or otherwise requires word verification for new posts")
{
return false;
}
else
{
throw exception;
}
}
if (response == null)
{
throw new Exception("Something went wrong");
}
return true;
}
-
sorunu sanırım çözdüm.Başkasının işine yarayabilir konu kalsın. multithreading kullanıyorsanız ve arkada başka bir webclient bağlantısı varsa onu kapatın ondan sonra post etmeye calısın. başka türlü olmuyor.
Edit 2: bunu sallamışta olabilirim tekrar bozuldu. bir çalışıyor bi bozuluyor :D önerilere açığım hala
edit3: post edilen veride sıkıntı çıkmış,bloggerda kabul etmeyince o hatayı vermiş :| daha spesifik bişiler verse direk müdahale edilir. ama sorun çözdüldü neyseki. üstteki kod sorunsuz.
FCN tarafından 22/Haz/13 22:19 tarihinde düzenlenmiştir
