dmarx / psaw

Python Pushshift.io API Wrapper (for comment/submission search)
BSD 2-Clause "Simplified" License
361 stars 53 forks source link

Cannot limit based on score #86

Open mattpodolak opened 4 years ago

mattpodolak commented 4 years ago
    posts = list(api.search_submissions(subreddit='hololive',
                                        before=before_date,
                                        after=after_date,
                                        filter = ['id', 'title', 'score'],
                                        limit=limit_per_period,
                                        is_video="false",
                                        score='>1000'
                                       ))

This should return results with a score greater than 1000 but it actually returns nothing.

Example of score usage with pushshift: https://api.pushshift.io/reddit/search/comment/?subreddit=hololive&sort=asc&size=15&sort_type=score&score=>1000

mattpodolak commented 4 years ago

I have tried encoding the > sign in the string:

    posts = list(api.search_submissions(subreddit='hololive',
                                        before=before_date,
                                        after=after_date,
                                        filter = ['id', 'title', 'score'],
                                        limit=limit_per_period,
                                        is_video="false",
                                        score='%3E1000'
                                       ))

This has been able to return results, which dont match the score requirement though.

created_utc:score
1603929144.0: 23
1603929071.0: 62
1603928339.0: 73
1603928980.0: 1
1603929430.0: 163
1603927200.0: 1
1603927099.0: 78
1603928227.0: 38
1603928198.0: 0
1603929030.0: 249
1603927049.0: 1
1603927998.0: 448
1603928555.0: 504
1603929182.0: 154
1603927132.0: 1181
1603929485.0: 10309
1603927030.0: 480
1603927119.0: 0
1603928595.0: 65
1603927169.0: 1
mattpodolak commented 4 years ago

Example with pushshift submissions: https://api.pushshift.io/reddit/search/submission/?subreddit=hololive&limit=10&fields=title,score&sort_by=score&score=%3E1000