diff options
| author | mcd223 <jacob@simplelittledream.com> | 2017-11-22 11:24:04 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-22 11:24:04 -0500 |
| commit | 63ad1bcd5f79d74d05bd6bd348a6116ebdc955ac (patch) | |
| tree | ab4f5d96978605d7f0a2b675f611c8a2bd4cfe53 /redditkarmacounter.py | |
| parent | 4ec9448ee7c5a47d66a964eb02118102cc570655 (diff) | |
Add files via upload
Diffstat (limited to 'redditkarmacounter.py')
| -rw-r--r-- | redditkarmacounter.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/redditkarmacounter.py b/redditkarmacounter.py new file mode 100644 index 0000000..85970c3 --- /dev/null +++ b/redditkarmacounter.py @@ -0,0 +1,25 @@ +import os
+import json
+import requests
+import praw #Makes sure we can use the module
+import time #now we can use the sleep command to wait a second
+#The next part will tell reddit that we are who we are, so that we can
+#grab info from our accounts.
+reddit = praw.Reddit(client_id='NuPI4zj-4u4DgQ', #Change this to the first string
+ client_secret='LTYtxrEYiOry61BHrKW6pULDSNY', #Change this to the secret string
+ user_agent='stats') #This can be anything, just give a title!
+
+me = reddit.redditor('McD223') #Defines the variable me as our account
+linkkarma = me.link_karma #Defines the variable linkkarma as our link karma
+commentkarma = me.comment_karma #Defines the variable commentkarma as our comment karma
+totalkarma = linkkarma + commentkarma #This will make a variable called totalkarma that will add both of the karma variables together.
+
+#now we can use those three variables in any program! for example lets make a program that tells us our karma every second!
+
+while True:
+ time.sleep(5)
+ os.system('clear')
+ print ('McD223 Reddit stats:')
+ print ('Link Karma:' ,linkkarma)
+ print ('Comment Karma:' ,commentkarma)
+ print ('Total Karma:' ,totalkarma)
|
