Looking for way to random add custom url to post content.

I have a multi site and I would like to allow my posts to add a specified link either randomly or using a keyword.

I have a shortcode that is already made up that would display the link I want but I don't know how to make it happen automatically or when a specified word or phrase is typed.

Example: I run an affiliate network - One of my users types a post on their blog site and the blog automatically puts their affiliate link in place ***or*** One of my users types a post on their blog and enter a keyword and that keyword or phrase becomes an automatic hyperlink.

Anyone have any Idea how I can do this?

Kindly,

Paul