Example #1
0
 def stats(self):
     parser = argparse.ArgumentParser(
         description='Get course post stats')
     parser.add_argument('network', help='Network ID for target Piazza class')
     args = parser.parse_args(sys.argv[2:])
     pz = piazza.Piazza(args.network, creds.auth)
     print(pz.get_stats())
Example #2
0
 def posts(self):
     parser = argparse.ArgumentParser(
         description='Get all posts visible to current user')
     parser.add_argument('network', help='Network ID for target Piazza class')
     args = parser.parse_args(sys.argv[2:])
     pz = piazza.Piazza(args.network, creds.auth)
     for i in pz.iter_all_posts():
         print(i)
Example #3
0
 def getuser(self):
     parser = argparse.ArgumentParser(
         description='Get user info')
     parser.add_argument('network', help='Network ID for target Piazza class')
     args = parser.parse_args(sys.argv[2:])
     pz = piazza.Piazza(args.network, creds.auth)
     profs = pz.get_user_profiles()
     print(profs)
Example #4
0
 def post(self):
     parser = argparse.ArgumentParser(
         description='Get all posts visible to current user')
     parser.add_argument('network', help='Network ID for target Piazza class')
     parser.add_argument('cid', help='Piazza post ID (cid)')
     args = parser.parse_args(sys.argv[2:])
     pz = piazza.Piazza(args.network, creds.auth)
     post = pz.get_post(args.cid)
     print(json.dumps(post))
Example #5
0
 def scrape(self):
     parser = argparse.ArgumentParser(
         description='Starting from post 1, capture each post until no more are found')
     parser.add_argument('network', help='Network ID for target Piazza class')
     parser.add_argument('out', help='Directory to write JSON')
     args = parser.parse_args(sys.argv[2:])
     pz = piazza.Piazza(args.network, creds.auth)
     post = pz.get_all(args.out)
     print(post)
Example #6
0
 def serve(self):
     parser = argparse.ArgumentParser(
         description='Start local development server')
     pz = piazza.Piazza()