我正在尝试使用我的tumblr feed中的X条目填充页面,我想知道如何只从它返回的JSON对象中提取该X数字.
这是我的代码,从另一个Stack Overflow帖子中提取并修改:
//Tumblr retrieval
$.getJSON("http://tumblr-address/api/read/json?callback=?",
function(data) {
$.each(data.posts, function(i,posts){
var title = this["regular-title"];
var type = this.type;
var date = this.date;
var url = this["url-with-slug"];
$('#sideRail ol').prepend('<li><p><a href=' +url +'>' + title + '</a></p><p>' + date + '</p></li>');
});
});
Run Code Online (Sandbox Code Playgroud)
我已经尝试使用带有计数器的while循环,但它只是重复所有X次,然后再转到列表中的下一个项目.
谢谢你的帮助.
我设置这个域的A记录指向这个tumblr:
emmaraviv.com :: timeoftstretched.tumblr.com
哪个工作正常,但www.emmaraviv.com没有.
在tumblr中,我将"自定义域"设置为"emmaraviv.com".我没有看到指定倍数的方法.即"emmaraviv.com","www.emmaraviv.com".
我为www.添加了另一个A记录,指向相同的IP(Tumblr告诉您使用的那个).但是当你试图专门访问这个记录地址时(www.emmaraviv.com.ryan-orourke.com - 它位于我主机上的主域名下)它会解析为Tumblr,但不是她的网站.这让我觉得问题是Tumblr没有认识到这个领域应该指向timeoftstretched.tumblr.com.
会喜欢一些想法吗?
谢谢!!
我正在使用http://(网站).tumblr.com/js填充我网站上的博客,但它只返回我的tumblr博客中最近的十篇帖子.我希望能够查找帖子11 - 20等较旧的帖子.有没有办法做到这一点?
谢谢
我的网站响应迅速.该博客节使用指向的tumblr的子域,但Respond.js的跨域版本无法正常工作.我这样做:
<script src="http://www.stevechab.com/scripts/respond.min.js"></script>
<link href="http://www.stevechab.com/scripts/respond-proxy.html" id="respond-proxy" rel="respond-proxy">
<link href="http://www.stevechab.com/scripts/respond.proxy.gif" id="respond-redirect" rel="respond-redirect">
<script src="http://www.stevechab.com/scripts/respond.proxy.js"></script>
Run Code Online (Sandbox Code Playgroud)
我假设问题是response.proxy.gif和respond.proxy.js不在blog.stevechab.com上......但是这不是打败了具有跨域版本的Respond.js的目的吗?我的假设是正确的,还是我错过了什么?有没有解决这个问题?
注意:我试过http://www.tumblr.com/themes/upload_static_file ...没有骰子.
我想通过Flickr,Tumblr,Instagram分享图片.我想用这3个已安装的应用程序执行此操作.我找到了Instagram:
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_TEXT, "" + getShareText());
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "" + getShareText());
shareIntent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file://" + file.getAbsolutePath()));
shareIntent.setPackage("com.instagram.android");
Run Code Online (Sandbox Code Playgroud)
我也可以拥有Tumblr和Flickr吗?是的,我可以通过集成库来完成Oauth流程.但我想通过特定安装的应用程序分享.
我试图登录到的tumblr使用方法CasperJS start,fill而waitForUrl却无法做到这一点.在我看来,表单未提交,因为waitForUr每次都过期超时.
终端响应:

我正在使用的代码是这样的:
/*jslint browser: true, regexp: true */
// global casper, require
var LOGIN_URL, LOGIN_USERNAME, LOGIN_PASSWORD, casper;
casper = require('casper').create({
waitTimeout: 20000,
viewportSize: {
width: 1024,
height: 768
},
verbose: true,
logLevel: 'debug',
userAgent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)'
});
if (!casper.cli.has('username') && !casper.cli.has('password')) {
casper.echo('Usage: $ casperjs sfdclogin.casper.js --username=USERNAME --password=PASSWORD').exit(-1);
}
LOGIN_URL = 'https://tumblr.com/login';
LOGIN_USERNAME = casper.cli.get('username');
LOGIN_PASSWORD = casper.cli.get('password');
phantom.cookiesEnabled = true;
casper …Run Code Online (Sandbox Code Playgroud) 我使用PyTumblr返回我的所有帖子,但它只返回20.我发现了post函数的kwarg,称为limit,但是当我指定1000时它仍然返回20.任何想法我做错了什么?
CLIENT = pt.TumblrRestClient(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET)
all_posts = CLIENT.posts(BLOG_URL, limit=1000)
Run Code Online (Sandbox Code Playgroud) 我在Firefox上加载字体时遇到问题.即使我尝试使用webfont,我仍然收到错误消息.我在Tumblr上使用它并通过主题资产上传字体.这是我得到的错误:
跨源请求已阻止:同源策略不允许在http://static.tumblr.com/ **/**** /neona-webfont.woff上读取远程资源.这可以通过将资源移动到同一域或启用CORS来解决.neona-webfont.woff可下载字体:下载失败(font-family:"neonaregular"样式:正常权重:正常拉伸:正常src索引:1):错误的URI或跨站点访问不允许来源:http:// static. tumblr.com/ **/**** /neona-webfont.woff
有人知道解决这个问题的方法吗?
提前谢谢.
我希望将页面从域(正确的子域)重定向到另一个维护相同路径组件的页面.
我正在使用博客服务,而不是运行服务器; 但我可以编辑我博客的全球负责人.
我已设法使用以下方法重定向到其他网站的主页面:
<meta http-equiv="refresh" content="1; url=http://subdomain-2.domain.com">
<script type="text/javascript">
window.location.href = "http://subdomain-2.domain.com"
</script>
Run Code Online (Sandbox Code Playgroud)
但我不能够重定向任何的第一个域的页面向相应的第二之一-说http://subdomain-1.example.com/post/lorem-ipsum-123来http://subdomain-2.example.com/post/lorem-ipsum-123.
我想知道是否可以抓取当前的URL并通过编辑头部将目标域替换为原始域.
我想我只能使用HTML,JavaScript或PHP.
我正在尝试在Tumblr Text帖子中使用高分辨率.当我将照片上传到文本帖子时,Tumblr将其调整为500px
图像显示:
<img src="http://41.media.tumblr.com/d8ceea903cb5cd667e416877bf4a8a70/tumblr_inline_nxihvl2VdX1r5y5rv_500.jpg" alt="image" data-orig-width="2640" data-orig-height="3960" width="500" height="750">
Run Code Online (Sandbox Code Playgroud)
如果我将500更改为data-orig-width值不会给我原始图像,但我只想要一个1280图像.如果我将500改为1280,它会给我一张1280的图像
500px:http://41.media.tumblr.com/d8ceea903cb5cd667e416877bf4a8a70/tumblr_inline_nxihvl2VdX1r5y5rv_500.jpg
1280px:http://41.media.tumblr.com/d8ceea903cb5cd667e416877bf4a8a70/tumblr_inline_nxihvl2VdX1r5y5rv_1280.jpg
我已经尝试将图像的属性从500更改为1280并且它可以工作,但只有当帖子包含一个上传的图像时,它才会更改使用html编辑器发布的图像.如果帖子包含从编辑器上传的2个图像,则jQuery代码将在1280中显示第一个图像两次,但它不显示第二个图像.
jQuery代码:
//Retrieve image src path
var img_url = $('.tmblr-full img').attr("src");
//Retrieve the width at which the image is displayed, 500px
var normal_width = parseInt($('.tmblr-full img').attr("width"));
//Replace 500px with the original image width or 1280
var new_url = img_url.replace(normal_width, 1280);
//Assign new widths to the src and to the width attributes
$(".tmblr-full img").attr( "width", 1280);
$(".tmblr-full img").attr( "src", new_url);
Run Code Online (Sandbox Code Playgroud)
我试过改变
var img_url = $('.tmblr-full img').attr("src"); …Run Code Online (Sandbox Code Playgroud)