Ejemplo n.º 1
0
		public async Task<ActionResult> Unlike(long postId, string reblogKey)
		{
			var tumblrApiClient = new TumblrApi(Request);
			await tumblrApiClient.Unlike(postId, reblogKey);

			return ApiViewDefault(new { response = true });
		}
Ejemplo n.º 2
0
		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);
		}
Ejemplo n.º 3
0
		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;
			}
		}
Ejemplo n.º 4
0
		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();
			}
		}