[https://i0.wp.com/www.foursides.ca/wp-content/uploads/2017/04/img_5801.jpg]
Courtesy of Blue Bottle Coffee
[http://www.foursides.ca/blue-bottle-coffee-review/]
> Because of the complexity of coffee and because of the way it drives us and
makes us feel, I think it occupies a special place in our culture. Because it’s
always been like that, over centuries. That sort of connectivity, that exchange,
is consistent.
— Peter Giuliano, Specialty Coffee
[https://bluebottlecoffee.com/u/foursides]
I have been subscribing to Tonx Coffee [https://www.foursides.ca/Tonx-Review/]
for several years now. Earlier in 2014, it was announced that Tonx would be
joining Blue Bottle Coffee [https://bluebottlecoffee.com/u/foursides]. The
fortunate thing is the coffee subscription service wasn’t
document.addEventListener('DOMContentLoaded', function() {
// Get all links in the document
const links = document.getElementsByTagName('a');
const currentDomain = 'foursides.ca';
const amazonAffiliateTag = 'four0b-20'; // Replace with your Amazon affiliate tag
// Process each link
Array.from(links).forEach(link => {
const href = link.getAttribute('href');
// Skip if link is null, empty, or just a hash
if (!href || href === '' || href.startsWith('#')) {
return;
}
try {
const url = new URL(href);
// Handle Amazon links
if (url.hostname.includes('amazon.')) {
// Remove any existing tag
url.searchParams.delete('tag');
// Add your affiliate tag
url.searchParams.set('tag', amazonAffiliateTag);
// Update the link attributes
link.setAttribute('href', url.toString());
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'nofollow noopener noreferrer');
}
// Handle other external links (not Amazon and not internal)
else if (!url.hostname.includes(currentDomain)) {
// Add referrer parameter
url.searchParams.set('ref', 'foursides.ca');
// Update the link attributes
link.setAttribute('href', url.toString());
link.setAttribute('target', '_blank');
link.setAttribute('rel', 'nofollow noopener noreferrer');
}
} catch (e) {
// If URL parsing fails, it's likely a relative URL (internal link)
// Do nothing for internal links
console.debug('Skipping internal link:', href);
}
});
});T