public async Task<ActionResult> Unlike(long postId, string reblogKey) { var tumblrApiClient = new TumblrApi(Request); await tumblrApiClient.Unlike(postId, reblogKey); return ApiViewDefault(new { response = true }); }
public new async Task PopulateModel(HttpRequestBase request, HttpResponseBase response) { await base.PopulateModel(request, response); var tumblrApi = new TumblrApi(request); this.Posts = await tumblrApi.GetPosts(BlogName, StartIndex, PostsPerPage); Post = await tumblrApi.GetPost(BlogName, this.Posts.Result[0].Id, true, true); this.BlogInfo = await tumblrApi.GetBlogInfo(BlogName); }
public new async Task PopulateModel(HttpRequestBase request, HttpResponseBase response) { await base.PopulateModel(request, response); var tumblrApi = new TumblrApi(request); if (Auth.IsAuthenticated(request)) { this.Dashboard = await tumblrApi.GetDashboard(Since, Start, PostsPerPage, PostType.All, false, false); this.Since = this.Since == 0 ? this.Dashboard[0].Id - 1 : this.Since; } }
public async Task PopulateModel(HttpRequestBase request, HttpResponseBase response) { this.Request = request; this.Response = response; this.PopulateAuthTokens(Request); if (this.IsAuthenticated()) { var tumbleApi = new TumblrApi(Request); CurrentUser = await tumbleApi.GetUserInfo(); } else { var auth = new Auth(); var authUrl = await auth.GetAuthRequestUrl(Request, Response); this.AuthUrl = authUrl.ToString(); } }