HOW TO display book titles in Amazon ads dynamically based on context or custom keywords

The Recommended Product Links Amazon widget can be adapted to display book titles in Amazon ads dynamically based on context or custom keywords.

Here is a GitHub Gist snippet that illustrates this -

<!DOCTYPE html>
<html>
<head>
<title>Show book titles in Amazon ads by keyword</title>
</head>
<body>
<div id="amz"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
amzn("India");
function amzn(keyword) {
var amzn = '<br><iframe src="http://rcm-na.amazon-adsystem.com/e/cm?t=webdevetipstr-20&o=1&p=48&l=st1&mode=books&search=' + keyword + '&fc1=000000&lt1=_blank&lc1=3366FF&bg1=FFFFFF&f=ifr" marginwidth="0" marginheight="0" width="728" height="90" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe>';
$("#amz").append(amzn);
}
});
</script>
</body>
</html>
view raw gistfile1.js hosted with ❤ by GitHub
I have used this in our app to search for free eBooks from the Google Books collection. It improves the app by showing results from an additional info source and helps surface free Kindle eBooks that may be available for a specified keyword.

Comments

Popular posts from this blog

The Mercurial Grok AI Assistant Understands & Speaks Indian Languages

Things Near Me – Find & Learn About Landmarks Nearby