by costco · 3y ago · 0 comments
func (c *Client) generateResultData(epoch int64) string {
return fmt.Sprintf("Epoch:%d|User-Agent:%s|Client-Vendor-ID:%s", epoch, c.userAgent, c.clientVendorID)
}
func (c *Client) generateBodyData(epoch int64, body []byte) string {
return fmt.Sprintf("Epoch:%d|Body:%s", epoch, string(body))
}
func hmacSignData(data string) string {
digester := hmac.New(sha256.New, []byte(REDDIT_ANDROID_HMAC_SECRET))
digester.Write([]byte(data))
return hex.EncodeToString(digester.Sum(nil))
}
REDDIT_ANDROID_OAUTH_CLIENT_ID = "ohXpoqrZYub1kg"
REDDIT_ANDROID_HMAC_SECRET = "8c7abaa5f905f70400c81bf3a1a101e75f7210104b1991f0cd5240aa80c4d99d"
And then use: https://oauth.reddit.com/r/%s/about.json
https://oauth.reddit.com/r/%s/top.json
https://oauth.reddit.com/search.json
etc.There's cool little parameters like rich text element, and other RPAN generally not available to the normal api.