-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile47.cs
More file actions
59 lines (41 loc) · 1.98 KB
/
file47.cs
File metadata and controls
59 lines (41 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TumblDotNet;
using TumblDotNet.Models;
namespace ConsoleTester
{
class Program
{
public const string TumblrConsumerKey = "t1ecRlHNgK9tfwRojPUwHrZwxyYUvp8LngbmZipinr3Yd7gbok";
public const string TumblrConsumerSecret = "bVKDKK38CobZXKlJhZF2AObh8cvkFeuOp0sAMW8LJtvNq99mBW";
public const string UserToken = "sYM9rfA8IbyJdkYyap8DQmhRlq46pupJSNJT0nciC9mFQ3nMjQ";
public const string UserSecret = "iAwgAi7okUtaX24i1H1eiVtWKkKqCU4kdAjDAaFcKcBSBNh3sb";
static void Main(string[] args)
{
#region OAuth Authentication
/*var reqToken = TumblrClient.GetRequestToken(TumblrConsumerKey,TumblrConsumerSecret);
var redirectUrl = TumblrClient.BuildAuthorizeUrl(reqToken);
Console.WriteLine(redirectUrl);
Console.Write("Enter verifier please:");
var verifier = Console.ReadLine();
var accessToken = TumblrClient.GetAccessToken(TumblrConsumerKey,TumblrConsumerSecret,reqToken, verifier);
Console.WriteLine("User secret: " + accessToken.UserSecret);
Console.WriteLine("User token: " + accessToken.UserToken);*/
#endregion
var client = new TumblrClient(TumblrConsumerKey,TumblrConsumerSecret,UserToken,UserSecret);
//var followers = client.GetBlogFollowers("rcknight.tumblr.com", 0, 12);
//try a request
var userInfo = client.GetUserInfo();
Console.WriteLine(userInfo.Blogs[0].Name);
var blogInfo = client.GetBlogInfo("danleech.com");
Console.WriteLine(blogInfo.Title);
var avatarUrl = client.GetAvatarUrl("danleech.com", 512);
var posts = client.GetBlogPosts("danleech.com",postType:PostType.Link);
var drafts = client.GetDrafts("rcknight.tumblr.com");
Console.WriteLine(avatarUrl);
Console.ReadLine();
}
}
}