如何使用 Javascript 显示我最新的 Tumblr 帖子的链接?

发布于 10-31 15:20 字数 392 浏览 3 评论 0原文

我正在寻求一些帮助,对此我将非常感激。我想使用 Javascript 显示我最新的 Tumblr 帖子的链接。例如,它会是这样的:

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

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

我知道我在 Twitter 上问过类似的问题。还有助于让它执行,因为显然我似乎也无法让它工作。再次,任何帮助都会很棒!

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>

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.

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我不咬妳我踢妳2024-11-07 15:20:11

我认为这会给你带来你所需要的:

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

编辑:好吧,忘记我以前有过什么。显然不适用于 tumblr。但这确实如此。

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);
});

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文