turnage / graw

Golang Reddit API Wrapper
MIT License
288 stars 50 forks source link

Get post response #64

Closed gastrodon closed 4 years ago

gastrodon commented 4 years ago

The purpose of this branch is to add functionality of getting references to posts or comments POSTed to Reddit when they are created. For example this is useful for bots that post content that requires a description comment or a flare to be added at post time. Because Reddit does not return full post objects when submitted, the Submission type is only meant to contain a name, id, and url to access those created resources normally.

This is done by adding account methods GetReply, GetPostSelf, and GetPostLink that use a new sow method get_sow, which itself uses a new parser method parse_submitted. The existing parsing method was not used because of differences in how Reddit formats json requests made with suffix .json and the url_param api_type=json that these new methods use.

Tests have been written for added methods, and mock types implement mock instances of these methods where they should.

turnage commented 4 years ago

Would you mind revising the git history? Many of these commits edit or reverse each other.

You can do this with git rebase HEAD~15 -i to re-order, squash, etc.

gastrodon commented 4 years ago

Would a squash and merge not be preferable for a feature branch? I'm not quite sure how exactly to go about revising this history, that's how I usually handle branches being merged into some master.

CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.

gastrodon commented 4 years ago

Hello @turnage, the commit history has been revised. My last comment can be disregarded. Because of the messy process I took in this branch, I opted to re-commit most of the files and overwrite this branch

turnage commented 4 years ago

Thank you for contributing! Please help yourself to contributors.md if you would like.