Commit Graph

36 Commits

Author SHA1 Message Date
guy176251 1d19dbcac7 changed read only url back 2026-05-28 12:56:09 -05:00
guy176251 52bdbec89a added request headers to debug log 2026-05-28 06:46:57 -05:00
guy176251 57129fcb83 changed read only url 2026-05-28 06:13:09 -05:00
guy176251 d7fc369cbd changed old repo references 2026-05-27 12:58:06 -05:00
guy176251 c959c91d0d added nsfw flag to search functions 2026-05-26 01:50:49 -05:00
guy176251 68b11ef35c added nsfw results for search functions 2026-05-25 18:36:52 -05:00
guy176251 d4a435b52f - removed ioutils in some spots
- fixed rate limit headers
- added poll data to post
- changed random os to windows for surf client
2026-05-25 16:21:13 -05:00
guy176251 3e62dda908 added gzip decompression of response body 2026-01-24 19:56:48 -06:00
guy176251 519f3f4f00 Added surf http client
- updated Makefile
- updated dependencies
2026-01-24 15:16:51 -06:00
guy176251 8c85da5472 Revert "initial attempt to integrate surf http client"
This reverts commit 538d52d064.
2026-01-24 15:00:30 -06:00
guy176251 538d52d064 initial attempt to integrate surf http client 2026-01-24 14:59:48 -06:00
Vartan Benohanian 6d615771cb Use Credentials struct for NewClient
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2021-01-24 22:55:37 -05:00
Vartan Benohanian 78dc97a8d5 Make DefaultClient a method that returns the global default client
I made this a method to prevent other users from reassigning the
previously exported DefaultClient, e.g. doing something like:

```go
reddit.DefaultClient = nil
```

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-11-01 22:25:13 -05:00
Vartan Benohanian d128a7c4f7 Remove "before" field from Response
Listing responses only ever contain a non-empty "before" field when the
"count" parameter is provided, which is only useful for the HTML
website, not really needed for API clients

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-29 14:19:32 -04:00
Vartan Benohanian 6f79da6e35 Rate limit errors, prevent requests if above limit
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-28 23:44:24 -04:00
Vartan Benohanian 6bdece7370 Create WidgetService
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-24 09:40:32 -04:00
Vartan Benohanian e01896137a Create getThing method to remove duplicate code
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-18 11:27:42 -04:00
Vartan Benohanian e73b89f0b8 Finish LiveThreadService
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-18 01:20:18 -04:00
Vartan Benohanian 359f8126a1 Create LiveThreadService
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-15 22:26:27 -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 ea2b3f138e Add methods to flair service, fix comment typo
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-08 20:36:28 -04:00
Vartan Benohanian 078b172e81 Add methods to ModerationService, attribute to Post, use go v1.15
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-07 21:24:14 -04:00
Vartan Benohanian 9d5132f15c Create WikiService
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-03 23:25:16 -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 b42aa44c44 Add Multi to thing struct
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-31 12:51:45 -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 37e712b334 Add global DefaultClient (readonly), WithUserAgent option
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-29 03:25:28 -04:00
Vartan Benohanian a14cb3a3c8 Remove FromEnv option, a few todos
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-27 18:23:29 -04:00
Vartan Benohanian c4faa00b94 Return errors on nil credentials, move code around
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-27 00:29:53 -04:00
Vartan Benohanian c0f0cf8be6 Set HTTP client via option. Update readme, Makefile, go.sum
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-26 23:13:34 -04:00
Vartan Benohanian e1ce8a7a14 Change libraryVersion variable value
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-25 21:38:36 -04:00
Vartan Benohanian ba5eea5ed4 Create Credentials struct
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-23 22:25:29 -04:00
Vartan Benohanian 49fa672619 Streaming new posts from subreddits
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-22 00:40:34 -04:00
Vartan Benohanian 407ee432a3 Change doc comment, some very minor tweaks
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-21 15:46:27 -04:00
Vartan Benohanian 8752bdd2d6 Create GoldService
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-20 17:04:44 -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