Commit Graph

8 Commits

Author SHA1 Message Date
Vartan Benohanian
f1b0d39a66 Remove duplicate code
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-13 22:20:00 -04:00
Vartan Benohanian
def7e3bdb7 Chage NewRequest methods, add multi description kind to thing
Since Reddit's API accepts form data as the body for most of its
endpoints, it made sense to me to make the default NewRequest method
set the request body as form data (if provided of course). The
NewJSONRequest method can accept a JSON body.

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-09 23:02:06 -04:00
Vartan Benohanian
ffcc906c07 Add Listing/KarmaList to thing struct, tweak anonymous structs
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-01 22:35:28 -04:00
Vartan Benohanian
5bb7a155de Return bool when type casting, include trophies in thing struct
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-01 20:36:37 -04:00
Vartan Benohanian
57ee41b2cf Do unmarshaling in thing struct
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-30 21:25:01 -04:00
Vartan Benohanian
2a1806ec33 Revamp listing decoding, include after/before anchors in response
Now, instead of returning an object containing a list of results + the
anchors, we return just the list. The anchors are available in the
response object. Much cleaner this way in my opinion

go-github and godo do it this way too. They include some meta
information in the returned response objects

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-29 14:23:37 -04:00
Vartan Benohanian
73945e9aae Edit comments
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-27 18:49:30 -04:00
Vartan Benohanian
f86a559d76 Move everything to new reddit/ folder
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-20 14:37:59 -04:00