Added demo for redditor_subreddit_activity, incremented version.

This commit is contained in:
David Marx
2018-08-13 21:33:43 -07:00
parent 9de960d0cc
commit d21c3e72d1
3 changed files with 32 additions and 3 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
Change Log
==========
dev
0.0.7 (2018/08/13)
------------------
* Add `redditor_subreddit_activity` convenience method
--> Needs demo in README
* Fixed bug that blocked backoff on request issued to determine current rate limit when
a new psaw instance is created.
* Fixed bug when using praw to get submission comments and no results returned.
0.0.6 (2018/08/06)
------------------
+29
View File
@@ -171,6 +171,35 @@ will contain the aggs result.
# {'doc_count': 1, 'key': 'reddit.com'}]}
len(list(gen)) # 312
Using the ``redditor_subreddit_activity`` convenience method
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you want to profile a redditors activity as in the ``aggs`` example, the
``redditor_subreddit_activity`` provides a simple shorthand for profiling a user by the subreddits
in which they are active, counting comments and submissions separately in a single call,
and returning Counter objects for commenting and posting activity, respectively.
api = PushshiftAPI()
result = api.redditor_subreddit_activity('nasa')
result
#{'comment':
# Counter({
# 'ExposurePorn': 1,
# 'IAmA': 300,
# 'Mars': 1,
# 'OldSchoolCool': 1,
# 'news': 1,
# 'pics': 1,
# 'reddit.com': 1,
# 'space': 6}),
# 'submission':
# Counter({
# 'IAmA': 3,
# 'ISS': 1,
# 'Mars': 1,
# 'space': 3,
# 'u_nasa': 86})}
Using the ``stop_condition`` argument to get the most recent submission by a bot account
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+1 -1
View File
@@ -6,4 +6,4 @@ https://github.com/dmarx/psaw
from .PushshiftAPI import PushshiftAPI, PushshiftAPIMinimal
__version__ = '0.0.6'
__version__ = '0.0.7'