hfaran / piazza-api

Unofficial Client for Piazza's Internal API
https://hfaran.github.io/posts/reverse-engineering-piazzas-api/
MIT License
185 stars 54 forks source link

Added functions for posting, replying to posts, pinning a post, and marking a post resolved. #45

Closed egregori3 closed 5 years ago

egregori3 commented 5 years ago

Added functions to support intelligent agents.

GitCop commented 5 years ago

There were the following issues with your Pull Request

Guidelines are available at https://github.com/hfaran/piazza-api


This message was auto-generated by https://gitcop.com

egregori3 commented 5 years ago

I am not sure what I need to do to get this fork pulled. Any suggestions?

GitCop commented 5 years ago

There were the following issues with your Pull Request

Guidelines are available at https://github.com/hfaran/piazza-api


This message was auto-generated by https://gitcop.com

GitCop commented 5 years ago

There were the following issues with your Pull Request

Guidelines are available at https://github.com/hfaran/piazza-api


This message was auto-generated by https://gitcop.com

GitCop commented 5 years ago

There were the following issues with your Pull Request

Guidelines are available at https://github.com/hfaran/piazza-api


This message was auto-generated by https://gitcop.com

GitCop commented 5 years ago

There were the following issues with your Pull Request

Guidelines are available at https://github.com/hfaran/piazza-api


This message was auto-generated by https://gitcop.com

egregori3 commented 5 years ago

Should have all issues resolved. I ran pylint. I think I got everything. Tested on sandbox; loks good.

egregori3 commented 5 years ago

from piazza_api import Piazza p = Piazza() p.user_login() Email: Password: n = p.network("") post = n.get_post(27) n.delete_post(post) 'OK' post=n.get_post(28) n.pin_post(post) {'item': {'folders': ['hw2'], 'nr': 28, 'main_version': 2, 'request_instructor': 0, 'log': [{'t': '2018-10-15T17:45:43Z', 'u': '', 'n': 'create'}, {'t': '2018-12-29T02:31:24Z', 'u': 'j', 'n': 'update'}], 'subject': 'adada', 'bucket_order': 0, 'no_answer_followup': 0, 'bucket_name': 'Pinned', 'num_favorites': 0, 'type': 'note', 'tags': ['hw2', 'instructor-note', 'pin'], 'log_p': [{'t': '2018-10-15T17:45:43Z', 'u': 'j', 'n': 'create'}, {'t': '2018-12-29T02:31:24Z', 'u': '', 'n': 'update'}], 'uid': '', 'unique_views': 6, 'content_snipet': 'abc\n#pin', 'view_adjust': 0, 'modified': '2018-12-29T02:31:24Z', 'id': '', 'updated': '2018-10-15T17:45:43Z', 'status': 'active'}}

post=n.get_post(684) n.resolve_post(post['children'][0]) {'anon': 'no', 'folders': [], 'data': None, 'no_upvotes': 0, 'subject': '

azsSADFsadf

', 'created': '2018-12-29T02:32:43Z', 'bucket_order': 2, 'bucket_name': 'Today', 'type': 'followup', 'uid': '', 'children': [], 'no_answer': 0, 'id': '', 'updated': '2018-12-29T02:32:43Z', 'config': {}}

hfaran commented 5 years ago

LGTM!