【发布时间】:2013-02-21 18:15:21
【问题描述】:
我遇到了一个函数,它使用它的 API 从 reddit 中获取热门图片。
sr='pics'
sorting=''
url = r'http://www.reddit.com/r/{sr}/{top}.json'.format(sr=sr, top=sorting)
但是我发现最初的编码员很早就发布了这样的内容:
#'sorting' is whether or not the sorting of the reddit should be customized or not,
# if it is: Allowed passing params/queries such as t=hour, week, month, year or all"""
我不确定如何使用这些其他“排序”命令,或者在哪里可以找到更多关于如何使用它们的信息。我什至不确定我是否应该更多地了解“排序”作为 json/reddit/python 表示法的一部分。
我想做的不仅是通过另一个查询获取由sorting=''定义的顶部图像,而且还获取底部图像(如果可能,以其他方式排序)。
【问题讨论】:
-
请参阅the official documentation 了解排序选项列表。
-
总是有source code。 :-)