Hello again,
Thanks for your feedback on my previous issues. I am able to pull "user actions" by using "_get()" however, I am unable to pull more than 200 users. I've tried setting the limit to 5000 but it will only return 200. My code below generates a dataframe called "schActivity" and it never has a length greater than 200 although there are over 4000 users in our schoology account. I have admin-level access to our schoology account. Any assistance would be greatly appreciated. Thanks!
Here is my code:
import schoolopy
import time
import datetime
import pandas as pd
import json
sc = schoolopy.Schoology(schoolopy.Auth('xxxxxxxxxxxxxxxxxxxx', 'yyyyyyyyyyyyyyyyyyy'))
sc.limit = 5000 # Only retrieve 10 objects max
sc.start = 1
d = datetime.date(2018,3,7)
unixtime = time.mktime(d.timetuple())
print(unixtime)
end = 1520406000
start = end - 86400
print('Start_time: ' + time.ctime(start))
print('End_time: ' + time.ctime(end))
schActivity = []
cnt = 0
cnt2 = 0
for i in sc.get_users():
#print(i)
schActivity.append(i['uid'])
studentActions = []
for k in schActivity:
k=int(k)
m = sc._get('analytics/users/%s?start_time=%s&end_time=%s&start=0' % (k, start, end))['actions']
if len(m) > 0:
studentActions.append(m)
Hello again,
Thanks for your feedback on my previous issues. I am able to pull "user actions" by using "_get()" however, I am unable to pull more than 200 users. I've tried setting the limit to 5000 but it will only return 200. My code below generates a dataframe called "schActivity" and it never has a length greater than 200 although there are over 4000 users in our schoology account. I have admin-level access to our schoology account. Any assistance would be greatly appreciated. Thanks!
Here is my code:
import schoolopy
import time
import datetime
import pandas as pd
import json
sc = schoolopy.Schoology(schoolopy.Auth('xxxxxxxxxxxxxxxxxxxx', 'yyyyyyyyyyyyyyyyyyy'))
sc.limit = 5000 # Only retrieve 10 objects max
sc.start = 1
d = datetime.date(2018,3,7)
unixtime = time.mktime(d.timetuple())
print(unixtime)
end = 1520406000
start = end - 86400
print('Start_time: ' + time.ctime(start))
print('End_time: ' + time.ctime(end))
schActivity = []
cnt = 0
cnt2 = 0
for i in sc.get_users():
#print(i)
schActivity.append(i['uid'])
studentActions = []
for k in schActivity:
k=int(k)
m = sc._get('analytics/users/%s?start_time=%s&end_time=%s&start=0' % (k, start, end))['actions']
if len(m) > 0:
studentActions.append(m)