Tumblr —在主页上获得8位数的reblog代码(几乎在那儿...) [英] Tumblr — getting the 8 digit reblog code on home page (nearly there...)
问题描述
我看到了两个狂野的网站,它们通过黑客设法在其主页上获得赞"和博客"按钮.
I've seen two sites in the wild which manage to get Like and Reblog buttons on their homepages via hacks.
这似乎是最好的参考文献: http://cicerontheme.tumblr.com/
This seems to be the best one to reference: http://cicerontheme.tumblr.com/
不知何故,他们设法获得了reblog URL,我不知道如何.我一直在翻遍他们的代码,而我发现的所有按钮都是这样的:
Somehow, they manage to get the reblog URL, how, i have no idea. I've been rummaging through their code and all I find is this for the like button:
$('a.likeLink').click(function() {
var post = $(this).closest('.post');
var id = post.attr('id');
var oath = post.attr('rel').slice(-8);
var like = 'http://www.tumblr.com/like/'+oath+'?id='+id;
$('#likeit').attr('src', like);
});
但同样,这并不能解决问题的关键,如何获取重新博客网址.
It's discussed a little in this Stack overflow discussion but again, does not get to the crux of the matter, how the heck to get the reblog url.
我已经遍历了脚本资源,还没有找到任何个人脚本,只是tumblr的脚本,我的chrome扩展程序等.他们从哪里得到的?!
I've gone through the script resources and havent found any personal scripts, just scripts from tumblr, my chrome extensions, etc. Where are they getting it from?!
在上面粘贴的"like"代码中,他们很容易获得帖子ID,您只需要使用Tumblrs {Permalink},但是重新博客网址是从rel属性获取的.
In the "like" code pasted above, they get the post ID easily enough, you just have to use Tumblrs {Permalink}, but the reblog url is taken from the rel attribute.
希望有人可以提供帮助!
Hoping someone can help!
谢谢.
推荐答案
很确定这不是JS东西-当您查看所链接网站的来源时,重新博客链接已经存在(意味着它们不存在). t被动态插入).
Pretty sure this isn't a JS thing — when you view the source of the site you linked, the reblog links are already there (meaning, they aren't being dynamically inserted).
我认为Ciceron主题实际上正在生成reblog链接-您是否尝试添加:
I think the the Ciceron theme is actually generating reblog links - have you tried adding:
<a href="{ReblogURL}">Reblog</a>
...以您的主题为背景?
...to your theme?
这篇关于Tumblr —在主页上获得8位数的reblog代码(几乎在那儿...)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!