我可以模仿的tumblr的互动,如一个reblog和喜欢通过他们的API? [英] Can I mimic Tumblr interaction such as reblog and like via their API?

查看:210
本文介绍了我可以模仿的tumblr的互动,如一个reblog和喜欢通过他们的API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我做了一个页面的网站,一个的tumblr应包括在内。我估计有两种方法去实现这一目标。

So, I'm doing a one page site where a Tumblr should be included. I figured there were two ways to go to achieve this.


  1. 的Iframe

  2. 的tumblr API

由于的Iframe感觉不好的做法,我想我会利用的tumblr的API。随着API密钥我可以获取从Tumblr的内容并把它的网站上,模仿的外观和感觉的tumblr的博客。

Since Iframe feels like bad practice I figured I'd make use of the Tumblr API. With an API key I can fetch content from the Tumblr and put it on the site and mimic the look and feel of a Tumblr blog.

现在我已经达到了我想要的包括功能,如跟踪,一个reblog和像点。这些都是可以使用API​​和OAuth为auth方法,但是,什么我现在想知道,因为我想模仿的tumblr博客的外观和感觉完全是,我真的不想弹出与交互时出现了的tumblr我已经得到了我的一个页面的网站(通过Twitter使用OAuth的东西时,你得到这个弹出窗口,要求你让我的许可任何事情发生之前)。

Now I've reached the point where I want to include functionality such as Follow, Reblog and Like. These are all possible using the API and Oauth as auth method, BUT, what I'm wondering now, as I want to mimic the look and feel of a Tumblr blog entirely, I really don't want a popup to appear when interacting with the "Tumblr" I've got on my one page site (when using Oauth stuff via Twitter you got this popup that asks you to allow my permission before anything happens).

是这样的情况?如果是这样,我只能求助于的iframe,包括在我的网站的tumblr饲料?

Will this be the case? If so, is my only resort to an Iframe to include a Tumblr feed in my site?

推荐答案

为了使用API​​的关注,一个reblog,而像功能,你将需要身份验证的用户,这需要最终用户访问授予您的API应用程序。

In order to use the Follow, Reblog, and Like features of the API you will need an authenticated user, which requires the end user to grant "access" to your API application.

在换句话说,是的,这样的弹出会出现要求用户给你的网站允许读取和写入他们的tumblr帐户。

In other words, yes, such a "pop up" will appear asking the user to give your site permission to "read and write" to their Tumblr account.

至于解决方法,即尚未完全整合,但通常会工作确定:

As workarounds, that are not quite fully integrated but will usually work OK:

要添加关注链接,包括一个链接到是这样的:

To add a Follow link, include a link to something like:

http://www.tumblr.com/follow/{Blog Name}

要包含一个reblog链接,包括一个链接是这样的:

To include a Reblog link, include a link something like:

http://www.tumblr.com/reblog/{Post ID}/{Reblog Key}

可从API获得的数据后可以得到一个reblog关键。

The "reblog key" can be obtained in the post data obtained from the API.

对于Like按钮 - 你只是永远不会得到那个没有经过认证的用户工作(即经历了弹出,并获得私有/公共密钥的OAuth访问用户的帐户tumblr)

As for the Like button -- you're just never going to get that to work without an authenticated user (ie, going through the "pop up" and obtaining private/public OAuth keys to access the user's tumblr account)

编辑:

但是,请记住您的Tumblr主题code里面您可以使用 {LikeButton} 。这将渲染< IFRAME> 通过的tumblr提供的元素实现了喜欢功能。这将有可能从你的tumblr的AJAX页面加载和分析这些< IFRAME方式> 元素,并将它们插入其中,根据需要动态

However, remember that inside your Tumblr theme code you can use {LikeButton}. This will render an <iframe> element provided by Tumblr that implements the "Like" feature. It would be possible to load pages from your Tumblr with AJAX and parse out these <iframe> elements and insert them where needed dynamically.

这篇关于我可以模仿的tumblr的互动,如一个reblog和喜欢通过他们的API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆