如何使用Javascript显示我最新的Tumblr帖子的链接? [英] How to display a link to my latest Tumblr post using Javascript?

查看:61
本文介绍了如何使用Javascript显示我最新的Tumblr帖子的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻求帮助,非常感谢。我想用Javascript来显示我最新的Tumblr帖子的链接。例如,它就像:

I am looking for some help and would be VERY grateful for it. I would like to use Javascript to display a link to my latest Tumblr post. For example, it would be like:

<a href="http://brianjsmith.tumblr.com/post/4486283258/welcome-to-my-tumblr">Read   Post</a>

正如您在上面的代码中看到的,链接是我最新的帖子。然而,最新的帖子(当然)会改变....我似乎无法在网上找到任何东西(我一直在谷歌搜索几个小时)而且我一直试图用Tumblr创建我自己的代码API设置没有运气。

As you can see in the above code, the link is to my latest post. However, the latest post is (of course) going to change.... I can't seem to find anything online (I've been searching Google for a few hours) and I have been trying to create my own code with Tumblr's API settings with no luck.

我知道我在Twitter上问过类似的问题。还有助于让它执行,因为显然我似乎无法使其工作。再一次任何帮助都会令人惊叹!

I know I asked a question similar to this for Twitter. Also help with getting it to execute, because apparently I can't seem to get that working either. And once again any help would be amazing!

推荐答案

我想这会得到你所需要的:

i think this will get you what you need:

$.getJSON('http://brianjsmith.tumblr.com/api/read/json?callback=?',
function(response) {
   $('#myLink').attr('href',response.posts[0].url);
});

编辑:好的,忘记我之前的情况。显然不适合tumblr。但这确实如此。

edit: ok, forget what i had before. doesn't work for tumblr apparently. this does though.

这篇关于如何使用Javascript显示我最新的Tumblr帖子的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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