async function fetchAndDisplayBooks() {
try {
let books = [{"title":"Bone Rattler: A Mystery of Colonial America","shorttitle":"Bone Rattler","authorstring":"Eliot Pattison","description":"In a novel rich in historical detail, acclaimed author Eliot Pattison reconsiders the founding of America and explores how disenfranchised people of any age and place struggle to find justice, how conflicting cultures can be reconciled through compassion and tolerance, and ultimately how the natural world has its own morality.\nAboard a British convict ship bound for the New World, protagonist Duncan McCallum witnesses a series of murders and apparent suicides among his fellow Scottish prisoners. A strange trail of clues leads Duncan into the New World and eventually thrusts him into the bloody maw of the French and Indian War. Duncan is indentured to the British Lord Ramsey, whose estate in the uncharted New York woodlands is a Heart of Darkness where multiple warring factions are engaged in physical, psychological, and spiritual battle.\nExploring a frontier world shrouded in danger and defying death in a wilderness populated by European settlers, Indian shamans, and mysterious scalping parties, Duncan, the exiled chief of his near-extinct Scottish clan, finds that sometimes justice cannot be reached unless the cultures and spirits of those involved are appeased.","descriptionHtml":"
In a novel rich in historical detail, acclaimed author Eliot Pattison reconsiders the founding of America and explores how disenfranchised people of any age and place struggle to find justice, how conflicting cultures can be reconciled through compassion and tolerance, and ultimately how the natural world has its own morality.
Aboard a British convict ship bound for the New World, protagonist Duncan McCallum witnesses a series of murders and apparent suicides among his fellow Scottish prisoners. A strange trail of clues leads Duncan into the New World and eventually thrusts him into the bloody maw of the French and Indian War. Duncan is indentured to the British Lord Ramsey, whose estate in the uncharted New York woodlands is a Heart of Darkness where multiple warring factions are engaged in physical, psychological, and spiritual battle.
Exploring a frontier world shrouded in danger and defying death in a wilderness populated by European settlers, Indian shamans, and mysterious scalping parties, Duncan, the exiled chief of his near-extinct Scottish clan, finds that sometimes justice cannot be reached unless the cultures and spirits of those involved are appeased.
","isbn":"B00C01FI7C","amazonurl":"http://www.amazon.com/Bone-Rattler-Mystery-Colonial-America/dp/B00C01FI7C?linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/Bone-Rattler--by--Eliot-Pattison--16829","tbr":"https://tbrapp.co/book/16829","AppleBooks":"https://goto.applebooks.apple/9781582434643","BarnesNoble":"https://www.barnesandnoble.com/s/B00C01FI7C","Bookshop":"https://bookshop.org/a/19558/9781582434643","coverarturl":"https://images-na.ssl-images-amazon.com/images/I/51ZnclX3pyL.jpg","bookid":"16829","publicationdate":"2009-01-01 00:00:00"},{"title":"The Republic of Pirates: Being the True and Surprising Story of the Caribbean Pirates and the Man Who Brought Them Down","shorttitle":"The Republic of Pirates","authorstring":"Colin Woodard","description":"In the early eighteenth century a number of the great pirate captains, including Edward \"Blackbeard\" Teach and \"Black Sam\" Bellamy, joined forces. This infamous \"Flying Gang\" was more than simply a thieving band of brothers. Many of its members had come to piracy as a revolt against conditions in the merchant fleet and in the cities and plantations in the Old and New Worlds. Inspired by notions of self-government, they established a crude but distinctive form of democracy in the Bahamas, carving out their own zone of freedom in which indentured servants were released and leaders chosen or deposed by a vote. They were ultimately overcome by their archnemesis, Captain Woodes Rogers—a merchant fleet owner and former privateer—and the brief though glorious moment of the Republic of Pirates came to an end. In this unique and fascinating book, Colin Woodard brings to life this virtually unexplored chapter in the Golden Age of Piracy.","descriptionHtml":"In the early eighteenth century a number of the great pirate captains, including Edward \"Blackbeard\" Teach and \"Black Sam\" Bellamy, joined forces. This infamous \"Flying Gang\" was more than simply a thieving band of brothers. Many of its members had come to piracy as a revolt against conditions in the merchant fleet and in the cities and plantations in the Old and New Worlds. Inspired by notions of self-government, they established a crude but distinctive form of democracy in the Bahamas, carving out their own zone of freedom in which indentured servants were released and leaders chosen or deposed by a vote. They were ultimately overcome by their archnemesis, Captain Woodes Rogers—a merchant fleet owner and former privateer—and the brief though glorious moment of the Republic of Pirates came to an end. In this unique and fascinating book, Colin Woodard brings to life this virtually unexplored chapter in the Golden Age of Piracy.
","isbn":"B003K15IKI","amazonurl":"http://www.amazon.com/The-Republic-Pirates-Surprising-Caribbean-ebook/dp/B003K15IKI?linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/The-Republic-of-Pirates--by--Colin-Woodard--11066","tbr":"https://tbrapp.co/book/11066","AppleBooks":"https://goto.applebooks.apple/9780156034623","BarnesNoble":"https://www.barnesandnoble.com/s/B003K15IKI","Bookshop":"https://bookshop.org/a/19558/9780156034623","coverarturl":"https://images-na.ssl-images-amazon.com/images/I/51haOb8yJQL.jpg","bookid":"11066","publicationdate":"2008-05-12 00:00:00"},{"title":"Henry V","shorttitle":"Henry V","authorstring":"Dan Jones","description":"The New York Times bestselling author returns with a biography examining the dramatic life and unparalleled leadership of England's greatest medieval king\n\nHenry V reigned over England for only nine years and four months and died at the age of just thirty-five, but he looms over the landscape of the late Middle Ages and beyond. The victor of Agincourt, he is remembered as the acme of kingship, a model to be closely imitated by his successors. William Shakespeare deployed Henry V as a study in youthful folly redirected to sober statesmanship. For one modern medievalist, Henry was, quite simply, “the greatest man who ever ruled England.”\n\nFor Dan Jones, Henry V is one of the most intriguing characters in all medieval history, but one of the hardest to pin down. He was a hardened, sometimes brutal warrior, yet he was also creative and artistic, with a bookish temperament. He was a leader who made many mistakes, who misjudged his friends and family, but he always seemed to triumph when it mattered. As king, he saved a shattered country from economic ruin, put down rebellions, and secured England’s borders; in foreign diplomacy, he made England a serious player once more. Yet through his conquests in northern France, he sowed the seeds for three generations of calamity at home, in the form of the Wars of the Roses.\n\nHenry V is a historical titan whose legacy has become a complicated one. To understand the man behind the legend, Jones first examines Henry’s years of apprenticeship, when he saw the downfall of one king and the turbulent reign of another. Upon his accession in 1413, he had already been politically and militarily active for years, and his extraordinary achievements as king would come shortly after, earning him an unparalleled historical reputation. Writing with his characteristic wit and style, Jones delivers a thrilling and unmissable life of England’s greatest king.","descriptionHtml":"The New York Times bestselling author returns with a biography examining the dramatic life and unparalleled leadership of England's greatest medieval king
Henry V reigned over England for only nine years and four months and died at the age of just thirty-five, but he looms over the landscape of the late Middle Ages and beyond. The victor of Agincourt, he is remembered as the acme of kingship, a model to be closely imitated by his successors. William Shakespeare deployed Henry V as a study in youthful folly redirected to sober statesmanship. For one modern medievalist, Henry was, quite simply, “the greatest man who ever ruled England.”
For Dan Jones, Henry V is one of the most intriguing characters in all medieval history, but one of the hardest to pin down. He was a hardened, sometimes brutal warrior, yet he was also creative and artistic, with a bookish temperament. He was a leader who made many mistakes, who misjudged his friends and family, but he always seemed to triumph when it mattered. As king, he saved a shattered country from economic ruin, put down rebellions, and secured England’s borders; in foreign diplomacy, he made England a serious player once more. Yet through his conquests in northern France, he sowed the seeds for three generations of calamity at home, in the form of the Wars of the Roses.
Henry V is a historical titan whose legacy has become a complicated one. To understand the man behind the legend, Jones first examines Henry’s years of apprenticeship, when he saw the downfall of one king and the turbulent reign of another. Upon his accession in 1413, he had already been politically and militarily active for years, and his extraordinary achievements as king would come shortly after, earning him an unparalleled historical reputation. Writing with his characteristic wit and style, Jones delivers a thrilling and unmissable life of England’s greatest king.","isbn":"0593652738","amazonurl":"https://www.amazon.com/dp/0593652738?linkCode=ll1&tag=codexmap-20&linkId=8d37aaf25f3947e1637a2ada957a9c8f&ref_=as_li_ss_tl","HawaiiProject":"https://www.thehawaiiproject.com/book/Henry-V--by--Dan-Jones--670205","tbr":"https://tbrapp.co/book/670205","AppleBooks":"https://goto.applebooks.apple/9781804541937","BarnesNoble":"https://www.barnesandnoble.com/s/0593652738","Bookshop":"https://bookshop.org/a/19558/9781804541937","coverarturl":"https://m.media-amazon.com/images/I/71gdnZ1N57L.jpg","bookid":"670205","publicationdate":"2024-09-12 00:00:00"}];
// Create a container for the book list
const bookList = document.createElement('div');
bookList.className = 'book-list';
// Add some basic styling
const style = document.createElement('style');
style.textContent = `
body {
--cover-width: 70px;
--cover-height: calc(var(--cover-width) * 1.55);
--cover-radius: 8px;
--cover-bordercolor: white;
--widget-background: black;
--widget-textcolor: white;
}
.book-list {
display: flex;
flex-direction: column;
gap: 10px;
padding: 4px;
max-widthX: 250px;
background: var(--widget-background);
}
.book-card {
display: flex;
flex-direction: row;
align-items: center;
overflow: hidden;
}
@media (max-width:1080px) {
.book-card {
flex-direction: column;
}
}
.book-cover-container {
flexX: 0 0 var(--cover-width);
width: var(--cover-width);
height: var(--cover-height);
border-radius: var(--cover-radius);
background: var(--cover-bordercolor);
displayX: flex;
padding: 2px;
}
.book-cover-link {
display: block;
height: 100%
}
.book-cover {
display: block;
widthX: var(--cover-width);
heightX: var(--cover-height);
border-radius: var(--cover-radius);
object-fit: cover;
height: 100%;
width: 100%;
marginX: 1px;
box-shadow: 0 0 1px 0px white inset, 0 0 1px 0px white;
}
.book-info {
flex: 1;
padding: 8px;
display: flex;
flex-direction: column;
justify-content: center;
background: var(--widget-background);
color: var(--widget-textcolor);
}
.book-title {
margin: 0 0 0px 0 !important;
font-size: 1rem;
font-weight: bold;
color: var(--widget-textcolor);
}
.book-author {
color: var(--widget-textcolor);
margin-bottom: 0px !important;
font-size: 0.75rem;
}
`;
document.head.appendChild(style);
// Create and append book cards
books.forEach(book => {
const bookCard = document.createElement('div');
bookCard.className = 'book-card';
// h2: margin-top: 0px;
bookCard.innerHTML = `
${book.shorttitle}
by ${book.authorstring}
`;
bookList.appendChild(bookCard);
});
// Add the book list to the document
const booksContainer = document.getElementById('4a62b298c678055518cec753d2d19442');
if (booksContainer) {
booksContainer.appendChild(bookList);
} else {
console.error('Element with id "books" not found');
}
//
var poweredDiv = document.createElement("div");
poweredDiv.setAttribute('style', 'padding-top: 4px; display: flex; justify-content: center; align-items: center;' );
var poweredImage = document.createElement("img");
var poweredLink = document.createElement("a");
var poweredImgLink = document.createElement("a");
poweredDiv.className ='LT_powered';
poweredImage.className ="favicon";
poweredImage.setAttribute('src', "https://bookshipapp.com/assets/icon/favicon.ico");
poweredImage.setAttribute('width', '16px');
poweredImage.setAttribute('height', '16px');
poweredLink.setAttribute('href', 'https://www.bookshipapp.com')
poweredLink.setAttribute('target', '_top');
poweredLink.setAttribute('style', 'display: flex;');
poweredLink.innerHTML='Powered by Bookship';
poweredImgLink.setAttribute('href', 'https://www.bookshipapp.com')
poweredImgLink.setAttribute('target', '_top');
poweredImgLink.setAttribute('style', 'display: flex;padding-right: 4px;');
poweredImgLink.appendChild(poweredImage);
poweredDiv.appendChild(poweredImgLink);
poweredDiv.appendChild(poweredLink);
booksContainer.appendChild(poweredDiv);
} catch (error) {
console.error('Error fetching or displaying books:', error);
const errorMessage = document.createElement('div');
errorMessage.style.color = 'red';
errorMessage.style.padding = '20px';
errorMessage.textContent = 'Sorry, there was an error loading the books.';
document.body.appendChild(errorMessage);
}
}
fetchAndDisplayBooks();
// Call the function when the document is loaded
// document.addEventListener('DOMContentLoaded', fetchAndDisplayBooks);