BUG? 个人主页无法读取到500篇以上内容 by oflyhigh

View this thread on steempeak.com
· @oflyhigh ·
$53.07
BUG? 个人主页无法读取到500篇以上内容
今天想用程序看一下自己的过往文章,用到的API是**`get_blog`**,原本想着是手到擒来的问题,没想到竟然遇到了问题。

![](https://steemitimages.com/DQmV82QacBZ7R9DQ7SetVh6ezBcHLK3VhUBvXarZ6HYNib7/image.png)
(图源 :[pixabay](https://pixabay.com))

# get_blog API


**`get_blog`** 用起来是很简单的,它有三个参数
* `account`: 带获取的用户名
* `start_entry_id`: 开始blog编号
* ` limit`:获取条目限制

其中**`start_entry_id`**即为开始从此**`entry_id`**向前查找。

**`entry_id`**我们可以理解成我们blog中文章(以及转发)的编号,最早的文章编号为0。但是API不支持获取直接读取**`entry_id`**为0的文章,因为**`start_entry_id`**为零代表最大的文章编号,也就是最新一篇文章。

如果想获取第0篇文章,我们可以将**`start_entry_id`**设置为1,然后**`limit`**设置成2,就会读回编号为1和0的文章。

以 @ned 为例
获取他的最早5篇文章,指令如下:
>`curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["get_blog", "get_blog", ["ned", 4, 5]], "id": 1}' https://api.steemit.com`

获取他的最新5篇文章,指令如下:
>`curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["get_blog", "get_blog", ["ned", 0, 5]], "id": 1}' https://api.steemit.com`


# 无法读取到500篇以上内容

一切看起来没有什么问题,但是当我尝试获取我的最早期文章时,返回为空!

>`curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["get_blog", "get_blog", ["oflyhigh", 4, 5]], "id": 1}' https://api.steemit.com`

返回如下:
>`{'id': 1, 'jsonrpc': '2.0', 'result': []}`

这是什么鬼?我首先想到难道就因为我不是创始人之一,就搞歧视吗?后来想想开源代码不会有这么变态的判断吧,一定是哪里搞错了。

于是我不断尝试,最终发现我可以获取我最近500篇文章(包含转发)。

# 问题所在

看了一下代码,但是限制了limit大小为500,但是这个限制的是单次读取的数目啊,我应该可以通过指定**`start_entry_id`**和**` limit`**获取任意条目才对。

![](https://steemitimages.com/DQmTaBtQzBKLZyRyjeVTQhLUah7kuaVJZkds4k2tUBayN7r/image.png)
上述代码中没能看出什么其它限制相关的。

于是我在想,是不是最多就只能读出500条呢?最终我找到如下代码:
![](https://steemitimages.com/DQmW6dSEX117T5YeYsTsywgfbaXtKjq9vgWFXuxjoJwJARv/image.png)
>uint32_t max_feed_size = 500;

以及位于**`follow_plugin::plugin_initialize`**中的这段代码
![](https://steemitimages.com/DQmYCHHFQzawqCXTcn2U81T2TA8TBXZYUCD463brJbhBpBb/image.png)

如此我们得出结论,能读出多少条目,取决于节点的**`max_feed_size`**的设置,默认情况是500条。再深奥的,比如**`max_feed_size`** 如何在 **`comment_operation`** 以及**` reblog_operation`**发生时影响对相关索引做的修改,以及最终如何影响**`get_blog`**获取的条目数,我就读不懂啦。

# STEEMIT如何处理这个问题

既然我们得出结论,由于节点**`max_feed_size`**的设置,我们无法读取某个用户500篇以前的文章,那么岂不是意味着**如果某个用户的文章(加转发)数目大于500,我们将无法在STEEMIT从个人博客(blog)中读到这些用户的早期文章?**

拿自己的账户试了一下,果然是这样!
![](https://steemitimages.com/DQmXW27yqKL17HzspmDH1AZocTNvSaz8M2XRg13DXH3bsjG/image.png)
翻我的主页,翻到这就再也翻不动了,在这之前,我可是还有近200篇文章呢😭 所以,STEEMIT如何处理这个问题?答案是STEEMIT根本没管这个问题!

# 如何翻阅早期文章?

尽管通过简单的阅读代码,我们知道了**这个是系统就这么设置的,算不得BUG**,但是不能阅读用户早期文章终归不爽啊。

那么如何翻阅用户早期文章呢?对于总计文章+转发低于500的用户,那么直接翻就可以了。

如果用户文章大于500,就需要一些其它手段喽,比如使用STEEMSQL或者STEEMDATA数据库等,这里就不再赘述了。大鹏 @dapeng 有个 [steemr工具也不错](https://steemit.com/cn/@dapeng/steemr-or-why-steemr-is-suddenly-popular),不过据说他要养活不起了😭
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 90 others
properties (23)
post_id40,593,769
authoroflyhigh
permlinkbug-500
categorysteemdev
json_metadata"{"format": "markdown", "links": ["https://pixabay.com", "https://steemit.com/cn/@dapeng/steemr-or-why-steemr-is-suddenly-popular"], "app": "steemit/0.1", "tags": ["steemdev", "steemit", "blog", "cn-programming", "cn"], "users": ["ned", "dapeng"], "image": ["https://steemitimages.com/DQmV82QacBZ7R9DQ7SetVh6ezBcHLK3VhUBvXarZ6HYNib7/image.png"]}"
created2018-03-26 10:41:30
last_update2018-03-26 10:41:30
depth0
children14
net_rshares20,805,234,018,838
last_payout2018-04-02 10:41:30
cashout_time1969-12-31 23:59:59
total_payout_value45.943 SBD
curator_payout_value7.128 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length2,548
author_reputation1,148,153,621,496,884
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (154)
@almira94 ·
Have a nice day my friend  @oflyhigh *∩_∩*
properties (22)
post_id40,593,883
authoralmira94
permlinkre-oflyhigh-bug-500-20180326t104221719z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "users": ["oflyhigh"], "tags": ["steemdev"]}"
created2018-03-26 10:42:33
last_update2018-03-26 10:42:33
depth1
children0
net_rshares0
last_payout2018-04-02 10:42:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length42
author_reputation-962,350,626,398
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@jaffer ·
每次o哥都让我们学到很多东西,太感谢了
properties (22)
post_id40,598,954
authorjaffer
permlinkre-oflyhigh-bug-500-20180326t112427434z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-26 11:24:30
last_update2018-03-26 11:24:30
depth1
children0
net_rshares0
last_payout2018-04-02 11:24:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length19
author_reputation220,461,792,063
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@vickylin ·
$0.09
我只想知道啥时候有人能倒腾出一个工具,让大家可以把文章一键导出😂我是个备份控啊,好想给自己的steemit文章备份起来
👍  
properties (23)
post_id40,604,904
authorvickylin
permlinkre-oflyhigh-bug-500-20180326t121114060z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-26 12:11:15
last_update2018-03-26 12:11:15
depth1
children5
net_rshares36,325,584,047
last_payout2018-04-02 12:11:15
cashout_time1969-12-31 23:59:59
total_payout_value0.068 SBD
curator_payout_value0.022 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length59
author_reputation-192,014,193,863
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@jiangchen ·
发文的时候把md文件保留好就行。
properties (22)
post_id40,614,532
authorjiangchen
permlinkre-vickylin-re-oflyhigh-bug-500-20180326t131736290z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-26 13:17:42
last_update2018-03-26 13:17:42
depth2
children0
net_rshares0
last_payout2018-04-02 13:17:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length16
author_reputation30,823,992,397,451
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@oflyhigh ·
很简单的,哪天我弄一个:)
properties (22)
post_id40,617,738
authoroflyhigh
permlinkre-vickylin-re-oflyhigh-bug-500-20180326t133928138z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-26 13:39:30
last_update2018-03-26 13:39:30
depth2
children1
net_rshares0
last_payout2018-04-02 13:39:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length13
author_reputation1,148,153,621,496,884
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@nostalgic1212 ·
我这是不是给你找到了明天写作的题材啦,哈哈哈哈哈哈哈(我这两个账号切换自如的让我觉得自己有影分身🤦‍♀️)
properties (22)
post_id40,622,542
authornostalgic1212
permlinkre-oflyhigh-re-vickylin-re-oflyhigh-bug-500-20180326t141158521z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-26 14:12:00
last_update2018-03-26 14:12:00
depth3
children0
net_rshares0
last_payout2018-04-02 14:12:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length53
author_reputation242,350,792,621,236
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@chaimyu ·
可以用我备份用的程序,我发上来了!
https://steemit.com/steem/@chaimyu/steem-steem
properties (22)
post_id40,761,582
authorchaimyu
permlinkre-vickylin-re-oflyhigh-bug-500-20180327t092903290z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "links": ["https://steemit.com/steem/@chaimyu/steem-steem"], "tags": ["steemdev"]}"
created2018-03-27 09:29:03
last_update2018-03-27 09:29:03
depth2
children0
net_rshares0
last_payout2018-04-03 09:29:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length64
author_reputation4,885,273,571,519
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@dapeng ·
$0.26
我提供这项服务,不仅备份,而且给你做个博客。如[我的博客](https://steemit.netlify.com),[deanliu 的博客](deancrypto.netlify.com)。这里是[服务条款](https://cnsteem.com/cn/@dapeng/or-10-sbd-to-build-a-mirror-site-for-your-own-steem-posts)。付费的。没办法,我得承担成本。
👍  
properties (23)
post_id40,779,289
authordapeng
permlinkre-vickylin-re-oflyhigh-bug-500-20180327t115204504z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "links": ["https://steemit.netlify.com", "deancrypto.netlify.com", "https://cnsteem.com/cn/@dapeng/or-10-sbd-to-build-a-mirror-site-for-your-own-steem-posts"], "tags": ["steemdev"]}"
created2018-03-27 11:52:06
last_update2018-03-27 11:52:06
depth2
children0
net_rshares102,087,417,238
last_payout2018-04-03 11:52:06
cashout_time1969-12-31 23:59:59
total_payout_value0.258 SBD
curator_payout_value0.001 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length212
author_reputation64,235,894,740,263
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@objc0 ·
求教,Steem 文章最终存储在哪里?一个完全节点中会留有之前的文章吗?
properties (22)
post_id40,713,202
authorobjc0
permlinkre-oflyhigh-bug-500-20180327t021839580z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-27 02:18:42
last_update2018-03-27 02:18:42
depth1
children2
net_rshares0
last_payout2018-04-03 02:18:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length36
author_reputation3,458,508,830
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@chaimyu ·
应该是这样的,但是视频什么的在不在链上还真得问@oflyhigh了
properties (22)
post_id40,761,792
authorchaimyu
permlinkre-objc0-re-oflyhigh-bug-500-20180327t093041470z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "users": ["oflyhigh"], "tags": ["steemdev"]}"
created2018-03-27 09:30:42
last_update2018-03-27 09:30:42
depth2
children1
net_rshares0
last_payout2018-04-03 09:30:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length33
author_reputation4,885,273,571,519
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@objc0 ·
多谢,按理说视频应该不在链上,否则一个节点肯定爆了,可行的方式是在链上存着数据指纹,真正的数据是链外存储的, Steem 怎么做的没仔细研究过,Dtube 上的视频貌似可以通过IPFS上传和存储。
properties (22)
post_id40,777,627
authorobjc0
permlinkre-chaimyu-re-objc0-re-oflyhigh-bug-500-20180327t113842925z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-27 11:39:00
last_update2018-03-27 11:39:00
depth3
children0
net_rshares0
last_payout2018-04-03 11:39:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length98
author_reputation3,458,508,830
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@jansonwon ·
$0.14
我们会帮大鹏养活steemr的
👍  , ,
properties (23)
post_id40,733,482
authorjansonwon
permlinkre-oflyhigh-bug-500-20180327t052235218z
categorysteemdev
json_metadata"{"app": "busy/2.4.0", "community": "busy", "tags": ["steemdev"]}"
created2018-03-27 05:22:36
last_update2018-03-27 05:22:36
depth1
children1
net_rshares56,026,912,108
last_payout2018-04-03 05:22:36
cashout_time1969-12-31 23:59:59
total_payout_value0.126 SBD
curator_payout_value0.013 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length15
author_reputation20,839,576,493
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (3)
@dapeng ·
多谢!已经取得联系。需要一段时间沟通
👍  
properties (23)
post_id40,779,574
authordapeng
permlinkre-jansonwon-re-oflyhigh-bug-500-20180327t115425261z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-27 11:54:27
last_update2018-03-27 11:54:27
depth2
children0
net_rshares493,033,538
last_payout2018-04-03 11:54:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length18
author_reputation64,235,894,740,263
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@dapeng ·
也不是完全养不起。每个月能养得起25小时,先到先得,用完了等下个月复活。
properties (22)
post_id40,779,809
authordapeng
permlinkre-oflyhigh-bug-500-20180327t115612848z
categorysteemdev
json_metadata"{"app": "steemit/0.1", "tags": ["steemdev"]}"
created2018-03-27 11:56:15
last_update2018-03-27 11:56:15
depth1
children0
net_rshares0
last_payout2018-04-03 11:56:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length36
author_reputation64,235,894,740,263
root_title"BUG? 个人主页无法读取到500篇以上内容"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000