Skip to content

Instantly share code, notes, and snippets.

@piedoom
Created August 19, 2016 22:52
Show Gist options
  • Save piedoom/f03e5cf56ef5136899627343347e57a1 to your computer and use it in GitHub Desktop.
Save piedoom/f03e5cf56ef5136899627343347e57a1 to your computer and use it in GitHub Desktop.
// first, we get a list of all posts
BasePost[] inbox = Client.GetSubmissionPostsAsync(TUMBLR_BLOG_NAME);
// loop through our inbox
foreach (var message in inbox)
{
// cast our generic BasePost to an AnswerPost to expose relevant information
AnswerPost ask = (AnswerPost)message;
// edit our post and publish
Client.EditPostAsync(
TUMBLR_BLOG_NAME,
ask.Id, PostData.CreateAnswer(
answer: "my response",
tags: new string[0],
state: PostCreationStatePublished));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment