如何修改 tumblr 书签以发布到特定的 tumblr 博客?
我有几个博客链接到我的 Tumblr 帐户,但 书签 始终选择我的“主要”博客(列表中的第一个)。
如何修改书签以便它自动选择特定博客?我想要多个书签链接,例如“在 blog1 上共享”、“在 blog2 上共享”,这样我就不必手动选择在哪个博客中创建帖子。
默认 Tumblr 书签 看起来像这样:
javascript: var d = document,
w = window,
e = w.getSelection,
k = d.getSelection,
x = d.selection,
s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)),
f = 'http://www.tumblr.com/share',
l = d.location,
e = encodeURIComponent,
p = '?v=3&u=' + e(l.href) + '&t=' + e(d.title) + '&s=' + e(s),
u = f + p;
try {
if (!/^(.*\.)?tumblr[^.]*$/.test(l.host)) throw (0);
tstbklt();
} catch (z) {
a = function () {
if (!w.open(u, 't', 'toolbar=0,resizable=0,status=1,width=450,height=430')) l.href = u;
};
if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0);
else a();
}
void(0)
I have a couple blogs linked to my Tumblr account, but the bookmarklet always selects my "primary" blog (the first one in the list).
How can I modify the bookmarklet so that it will auto-select a specific blog? I would like to have multiple bookmarklet links, e.g. "Share on blog1", "Share on blog2" so that I don't have to manually select which blog to create the post in.
Default Tumblr bookmarklet looks like this:
javascript: var d = document,
w = window,
e = w.getSelection,
k = d.getSelection,
x = d.selection,
s = (e ? e() : (k) ? k() : (x ? x.createRange().text : 0)),
f = 'http://www.tumblr.com/share',
l = d.location,
e = encodeURIComponent,
p = '?v=3&u=' + e(l.href) + '&t=' + e(d.title) + '&s=' + e(s),
u = f + p;
try {
if (!/^(.*\.)?tumblr[^.]*$/.test(l.host)) throw (0);
tstbklt();
} catch (z) {
a = function () {
if (!w.open(u, 't', 'toolbar=0,resizable=0,status=1,width=450,height=430')) l.href = u;
};
if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0);
else a();
}
void(0)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为书签提供一个
'channel_id'
post 参数,即example_blog_name.tumblr.com
中的'example_blog_name'
Give the bookmarklet a
'channel_id'
post parameter which is'example_blog_name'
inexample_blog_name.tumblr.com
结合使用用户脚本和对小书签进行一些调整,这是您的解决方案:
将其安装为 UserScript :
编辑
BLOG_NAME
变量后,将其保存为您的小书签。与下拉列表中的内容完全一样地输入。另外,您可能需要通过 UglifyJS 运行它才能使其成为书签。Using a combination of a user script, and a little tweaking to the bookmarklet, here's your solution:
Install this as a UserScript:
Save this as your bookmarklet after editing the
BLOG_NAME
variable. Type it exactly as it is in the dropdown. Also, you'll probably have to run it through UglifyJS to make it a bookmarklet.