1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

7 Commits

Author SHA1 Message Date
Chris Cummer
cde904ff08
Use errcheck to find unhandled errors (#795)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-17 08:26:16 -08:00
Chris Cummer
3a388fba23
20191215 code improvements (#790)
* Upgrade godo to latest
* Fix a bunch of issues found by
* Running staticcheck on a codebase for the first time is a sobering experience
* go mod tidy
* More static improvements

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-16 20:25:29 -08:00
Casey Primozic
a99af9a091
Support both bearer + consumer tokens for Twitter modules
* Add support to both the twitter and twitterstats modules for authenticating using both bearer tokens as well as consumer key + secret.
  * A bearer token is defaulted to if it's supplied
  * Add this support to both the twitterstats module as well as to the existing twitter module, modifying its functionality to re-use the same HTTP client and handle authentication upfront via oauth2
2019-10-29 03:15:57 -07:00
Casey Primozic
d82eda1933
Improvements to twitterstats code from review
* Unmarshal directly into a `TwitterStats` struct by using json struct annotations
 * Pull stats fetching for a single user out into its own function so that closing the request body is done after each request and the HTTP request can be re-used for multiple usernames' stats
 * Improve type casting code used in settings parsing logic
2019-10-23 11:49:33 -07:00
Casey Primozic
3c95d8e39d
Improve styling + remove unused code
* Got rid of unused struct fields, unused settings, added some comments to functions + structs
2019-10-22 13:23:17 -07:00
Casey Primozic
0be63a404c
Implement Twitter API fetching for twitterstats
* Create Oauth2 client configured for Twitter and create a HTTP client out of that
 * Fetch user stats for each of the users, parse out of JSON, and return stats as stats structs
2019-10-22 12:42:11 -07:00
Casey Primozic
4c9990bafd
Implement initial twitterstats module
* Create module skeleton based off of the existing twitter module
  * Strip out unused pieces and try to make it as minimal as possible
 * Implement settings parsing, converting the untyped `screenNames` slice into an slice of strings
 * Implement initial minimal display, showing a table with all usernames and their follower count + # of tweets (using dummy metrics for now)
2019-10-22 11:58:20 -07:00