小编mcr*_*ken的帖子

用Tweepy回复Tweet - Python

回复一个特定的推文时,我似乎无法解决这个问题:

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)

api = tweepy.API(auth)

### at this point I've grabbed the tweet and loaded it to JSON...

tweetId = tweet['results'][0]['id']

api.update_status('My status update',tweetId)
Run Code Online (Sandbox Code Playgroud)

api说它需要可选参数而in_reply_to_status_id是第一个,但它似乎完全忽略了它.此脚本将发布更新状态,但它不会将其链接为对我传递的tweetId的回复.

API供参考:http://code.google.com/p/tweepy/wiki/APIReference#update_status

有人有主意吗?我觉得我在这里错过了一些简单的东西......

提前致谢.

python twitter tweepy

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

jQuery可以确定哪些div目前在用户的浏览器视图中?

是否有可能确定当前在浏览器视图中的哪个div,然后在发生这种情况时触发事件?基本上,我有一个网站,在一个页面上有5-6个部分,我想根据浏览器当前查看的部分来激活事件.我知道我们可以使用hrefs中的#tag直接链接到页面的位置,但这是否可以确定哪个目前在浏览器的主视图中?

jquery events javascript-events

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

PhpStorm LiveEdit HTML可以工作,但CSS没有

我刚刚在PhpStorm 7.0中设置了LiveEdit并下载了Chrome扩展程序"JetBrains IDE Support"v1.25.我还设置了一个Javascript Debug运行配置.当我在PhpStorm中运行此配置并编辑HTML文件时,我的Chrome浏览器中的页面会按预期重新加载.但是,如果我编辑我的CSS文件,除非我重新加载页面,否则更改不会反映在我的浏览器中.

其他人遇到过这个问题吗?我用谷歌搜索了一下,但还没有想出任何东西.我很难过,因为HTML编辑工作正常......

google-chrome-extension phpstorm liveedit

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

这是什么类型的编码?有人告诉我它是Bencode,但它看起来并不标准

我正在一个项目中,他们在mysql数据库的BLOB类型列中存储了以下类型的编码数据。我四处询问,并被告知这是Bencode,但是,据我在线所见,它似乎不是标准的Bencode。

Bencode的Wiki

http://en.wikipedia.org/wiki/Bencode

编码数据示例

a:11:{i:0;a:3:{s:11:"question_id";s:2:"46";s:6:"answer";s:1:"2";s:7:"correct";b:1;}i:1;a:3:{s:11:"question_id";s:2:"45";s:6:"answer";s:1:"2";s:7:"correct";b:0;}i:2;a:3:{s:11:"question_id";s:2:"44";s:6:"answer";s:1:"2";s:7:"correct";b:0;}i:3;a:3:{s:11:"question_id";s:2:"43";s:6:"answer";s:1:"1";s:7:"correct";b:0;}i:4;a:3:{s:11:"question_id";s:2:"42";s:6:"answer";s:1:"3";s:7:"correct";b:0;}i:5;a:3:{s:11:"question_id";s:2:"41";s:6:"answer";s:1:"2";s:7:"correct";b:0;}i:6;a:3:{s:11:"question_id";s:2:"40";s:6:"answer";s:1:"0";s:7:"correct";b:1;}i:7;a:3:{s:11:"question_id";s:2:"39";s:6:"answer";s:1:"0";s:7:"correct";b:0;}i:8;a:3:{s:11:"question_id";s:2:"38";s:6:"answer";s:1:"1";s:7:"correct";b:1;}i:9;a:3:{s:11:"question_id";s:2:"37";s:6:"answer";s:1:"3";s:7:"correct";b:0;}i:10;a:3:{s:11:"question_id";s:2:"36";s:6:"answer";s:1:"2";s:7:"correct";b:1;}}
Run Code Online (Sandbox Code Playgroud)

到目前为止我所注意到的

我注意到,编码使用类似于Bencode的字母和整数描述了不同类型的数据。

例: s:11:"question_id";

我假设s代表'string',那11是定义string的长度question_id。另外,似乎数据(a:11:)的开头描述了一个长度为11的数组。尽管这与标准Bencode相似,但似乎并没有使用Bencode使用的标准语法。

有谁知道这是什么类型的编码?这是非标准的Bencode格式,还是完全不同?我正在寻找PHP或Python中的解析器,并且为编码指定名称肯定会对我的搜索有所帮助。

encoding encode

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