Last active
August 25, 2016 07:02
-
-
Save piedoom/41484cf5b3d853793d8773c6e788e416 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DontPanic.TumblrSharp; | |
using DontPanic.TumblrSharp.Client; | |
using System; | |
namespace TumblrBotTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Tumblr.Client.CreatePostAsync( | |
// Tumblr.BlogName, PostData.CreateText("this is a text #cool #bot #wow") | |
// ); | |
// var me = Tumblr.Client.GetBlogInfoAsync(Tumblr.BlogName).Result; | |
// Console.WriteLine(me.PostsCount); | |
var inbox = Tumblr.Client.GetSubmissionPostsAsync(Tumblr.BlogName).Result; | |
foreach (var message in inbox) | |
{ | |
var msg = (AnswerPost)message; | |
Console.WriteLine(); | |
Tumblr.Client.EditPostAsync( | |
Tumblr.BlogName, msg.Id, PostData.CreateAnswer( | |
"hello", null, PostCreationState.Published)); | |
} | |
Console.ReadLine(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DontPanic.TumblrSharp; | |
using DontPanic.TumblrSharp.Client; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace TumblrBotTest | |
{ | |
public static class Tumblr | |
{ | |
const string CONSUMER_KEY; | |
const string CONSUMER_SECRET; | |
const string OAUTH_TOKEN; | |
const string OAUTH_TOKEN_SECRET; | |
static public TumblrClient Client; | |
static public string BlogName { get; set; } = "somethinginterestingbot"; | |
static Tumblr() | |
{ | |
Client = new TumblrClientFactory().Create<TumblrClient>( | |
CONSUMER_KEY, | |
CONSUMER_SECRET, | |
new DontPanic.TumblrSharp.OAuth.Token( | |
OAUTH_TOKEN, OAUTH_TOKEN_SECRET)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment