在2015年5月找到关于Reddit的最高得分评论

时间:2015-07-21 07:20:57

标签: php reddit

我想用PHP编写一个页面(本质上),它可以告诉我2015年5月或2015年的最高得分评论。我该怎么做呢?

我发现了这个PHP api:

https://github.com/jcleblanc/reddit-php-sdk

但它似乎只是显示如何登录帖子评论等。我想查询数据库,我该怎么做呢?

2 个答案:

答案 0 :(得分:0)

为什么不查看reddit api docs http://www.reddit.com/dev/api它有关于您可以从reddit访问哪些信息的所有信息。该库/包只为reddit API提供了一个前端。

如果找不到合适的reddit客户端库,可以使用Guzzle或类似的方式向API提出请求。

答案 1 :(得分:0)

But it just seems to show how to log in a post comments etc. I want to query the Database, how do I go about doing that?

You don't. HTTP APIs generally don't allow arbitrary queries of that kind, and reddit in particular does not for performance reasons.

The only place I can think of that sorts individual comments by :attach_block is the userpage, and building a list of millions of users and trying to scrape through their userpages to gather top comments (and place them into monthly buckets) will probably take much longer than you'd like.