标签: tumblr

当Python认为值是字符串时,如何找到字典中的最大值?

我正在使用Tumblr API——我想构建一个小工具,它将我的所有帖子拉到我的各个 Tumblr 上,并每周一次将它们存档到我的 WordPress 博客中。

所以每次脚本运行时,我想记录最大帖子 ID。所以我试图让这样的事情发挥作用:

    jdata = json.loads(rawjson)
    jposts = jdata['response']['posts']
    for post in jposts:
        print post['id'] 
    print max(jposts['id'])
Run Code Online (Sandbox Code Playgroud)

我得到的是很多帖子 id(预期), list indices must be integers, not str但如果我这样做,print type(post['id'])Python 会将它们识别为<type 'long'>. 那么...我在这里做错了什么?

以下是Tumblr 示例输出的片段,您可以使用它rawjson

{
   "meta":{
      "status":200,
      "msg":"OK"
   },
   "response":{
      "blog":{
         "title":"Scipsy",
         "name":"scipsy",
         "posts":8524,
         "url":"http:\/\/scipsy.tumblr.com\/",
         "updated":1365196814,
         "description":"\u0022Science is interesting and if you don\u0027t agree, fuck off\u0022",
         "ask":true,
         "ask_anon":true,
         "is_nsfw":false,
         "share_likes":false
      },
      "posts":[
         {
            "blog_name":"scipsy",
            "id":47218422365,
            "post_url":"http:\/\/scipsy.tumblr.com\/post\/47218422365\/you-are-missed-that-is-all",
            "slug":"you-are-missed-that-is-all",
            "type":"answer", …
Run Code Online (Sandbox Code Playgroud)

python json tumblr

1
推荐指数
1
解决办法
5907
查看次数

tumblr 主题上的像素艺术风格边框

我想在我的 #wrap 周围创建一个像素艺术风格的边框 - 基本上只是边框的角被切掉,如下所示:

像素化边框

我很难弄清楚它(当涉及到 css 和 html 时,我完全是个初学者,而且大多数时候只是用它来调整我的 tumblr 网站)。这是网站上当前代码和边框的样子:

        #wrap {
        width: 500px;
        margin: 0 auto;
        padding: 50px;
        background: #fff;
        background: rgb(225, 225, 225);
        background: rgba(255, 255, 255, 0.95);
        border: 5px solid #000;
    }
    
Run Code Online (Sandbox Code Playgroud)

正常边框

有谁知道我该如何实现这个?我认为删除边框的角很容易,但我在网上找不到任何指导。

谢谢。

html css border pixel tumblr

1
推荐指数
1
解决办法
2587
查看次数

是否有适用于iOS的Tumblr API?

我想在我的iOS应用中添加简单的Tumblr帖子.是否有可用于执行此操作的插件API(最好由Tumblr直接制作)?

api tumblr ios

0
推荐指数
1
解决办法
3282
查看次数

Tumblr的UIDocumentInteractionController

我需要在Tumblr中分享照片,在iOS中使用app Tumblr.

对于Instagram我喜欢这样:

  NSData *imageData = UIImageJPEGRepresentation(self.test.image, 1.0);

    NSString *writePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"instagram.igo"];
    if (![imageData writeToFile:writePath atomically:YES]) {
        NSLog(@"image save failed to path %@", writePath);
        return;
    } 

    // send it to instagram.
    NSURL *fileURL = [NSURL fileURLWithPath:writePath];
    self.documentController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
    [self.documentController setUTI:@"com.instagram.exclusivegram"];
    [self.documentController setAnnotation:@{@"InstagramCaption" : @"#hey"}];

    if (![self.documentController presentOpenInMenuFromRect:self.view.frame inView:self.view animated:YES]) NSLog(@"couldn't present document interaction controller");
Run Code Online (Sandbox Code Playgroud)

但是我不知道怎么会这样,但对于Tumblr,谢谢

iphone sharing tumblr ios

0
推荐指数
1
解决办法
606
查看次数

Tumblr Photo/Photoset弹出窗口

我使用的主题让photoset图像弹出到灰色画廊幻灯片放映.如果我只发布一张照片,即使我插入点击后到达网址也没有任何反应.我想为所有图像设置灰色幻灯片库.在仪表板上它可以工作,但不在主题中.

我认为有些代码丢失了,但我不知道.有人可以看看吗,拜托?

我使用这个主题http://mindspalace.tumblr.com

tumblr

0
推荐指数
1
解决办法
5096
查看次数

将Dropbox网站嵌入HTML网站

这是我目前的网站:http://acrossuhubsubmissions.tumblr.com/.如您所见,我正在使用iFrame将Dropbox的一部分嵌入我的tumblr网站.Dropbox页面是一个公共共享页面.我用来显示Dropbox的html代码:

<left>
<iframe src ="https://www.dropbox.com/sh/d9ulw65twvxrrhi/AACHsXLlXUSan4Zx4hGC8BDja?lst"  width="777px" height="777px"   scrolling="yes"  >
  <p>Your browser does not support iframes.</p>
</iframe></left>
Run Code Online (Sandbox Code Playgroud)

我在Google speadsheet网页上使用了完全相同的代码,而这似乎显示出来了.有谁知道为什么Dropbox网页没有显示在我的tumblr页面上?

html iframe dropbox tumblr

0
推荐指数
1
解决办法
2万
查看次数

CSS border-radius 属性不起作用

我在 Tumblr 上运行我的网站。我刚刚添加了 CSS Border-Radius 属性,并将所有具有特定 ID 的图像设置为 20px。但是,正如您所看到的,图像右侧的角没有正确圆角,但左侧角是圆角。

CSS 代码如下所示:

#articleimage {
    float:left;
    padding-right: 10px;
    padding-bottom: 1px;
    width: 400px;
    border-radius:20px;
}
Run Code Online (Sandbox Code Playgroud)

我已经确定问题是由右侧的填充引起的,但我需要该 CSS 属性。我怎样才能停止这种冲突?

查看截图:http : //i.stack.imgur.com/es0aa.png

html css image tumblr

0
推荐指数
1
解决办法
1万
查看次数

删除CSS引起的随机空格

我正在为Tumblr创建一个主题,本地一切正常.然而,当我将代码粘贴到Tumblr编辑器并在网站上预览时,页面顶部会出现一个空白区域.我已经浏览了CSS并且无法弄清楚它为什么会出现.任何想法我都尝试了一切.

Tumblr地址是http://storyline-expose.tumblr.com密码,它是WIP

问题的屏幕截图: 问题的屏幕截图

html css tumblr

-1
推荐指数
1
解决办法
211
查看次数

标签 统计

tumblr ×8

html ×4

css ×3

ios ×2

api ×1

border ×1

dropbox ×1

iframe ×1

image ×1

iphone ×1

json ×1

pixel ×1

python ×1

sharing ×1