private async void btnTest_Click(object sender, EventArgs e) { // create TumblrClient TumblrClientFactory fTumblrFactory = new TumblrClientFactory(); tumblrClient = fTumblrFactory.Create <TumblrClient>(eConsumerKey.Text, eConsumerSecret.Text, new Token(eAccessKey.Text, eAccessSecret.Text)); // Queries user info var userInfo = await tumblrClient.GetUserInfoAsync(); MessageBox.Show("Number of Blogs is you following: " + userInfo.FollowingCount.ToString()); }
public async Task GetBlogInfoAsync() { //instantiate the client factory var factory = new TumblrClientFactory(); //create the client; TumblrClient implements IDisposable (to dispose //of the internal HttpClient) using (var client = factory.Create<TumblrClient>(consumerKey, consumerSecret, token)) { //gets the info for a blog; we can either pass the short blog name or //the fully qualified blog name (<blog name>.tumblr.com) var blogInfo = await client.GetBlogInfoAsync("thegetty"); } }
private static async Task <List <BasePost> > DownloadPostsData() { var factory = new TumblrClientFactory(); var client = factory.Create <TumblrClient>(Credentials.Key, Credentials.Secret); var posts = new List <BasePost>(); for (int i = 0; i < 1000; i += 20) { var next = await client.GetPostsAsync("malowiele", i, 20, PostType.Photo); posts.AddRange(next.Result.ToList()); } return(posts); }