You could use a service like viglink, or skimlinks
They both have tens of thousands of merchants and will add links to sites that will pay out more. As far as I know, only viglink will also add links into text. For example if I type “Samsung Galaxy s5” it will add a link to a site with an affiliate link.
Disclaimer: I do not work for either of those services.
This could be nice for Discourse because in the settings you could add your ID, and Discourse could have their own affiliate link to the site from the settings panel for users to sign up. I might make a plugin for this at some point