Extract course titles from web pages and generate 500 unique variations using Google API
Here's a sample HTML page with a course title in an <h1> tag:
<!DOCTYPE html>
<html>
<head>
<title>Sample Course Page</title>
</head>
<body>
<h1>Advanced Certificate in Precision Agriculture Agribusiness Management</h1>
<p>Course description and content here...</p>
</body>
</html>
✅ Application is running successfully on http://localhost:5260
🔧 Database: SQL Server (tbl_courses table)
🌐 Google API Integration: Ready
🔗 External Website API: Ready
⚡ Status: Operational
Add this JavaScript code to external websites to automatically process course titles:
// Course Title Processor - Add this to your website
(function() {
'use strict';
const BASE_URL = 'https://intelligence.lsib.co.uk';
function processPage() {
const h1Element = document.querySelector('h1');
if (!h1Element) return;
const title = h1Element.textContent.trim();
const url = window.location.href;
if (isCoursePage(title, url)) {
sendToAPI(title, url);
}
}
function isCoursePage(title, url) {
const courseKeywords = ['course', 'training', 'certificate', 'program', 'learning'];
const titleLower = title.toLowerCase();
return courseKeywords.some(keyword => titleLower.includes(keyword));
}
function sendToAPI(title, url) {
const encodedTitle = encodeURIComponent(title);
const encodedUrl = encodeURIComponent(url);
const apiUrl = `${BASE_URL}/IndexTitlesShortCourseV2?courseTitle=${encodedTitle}&sourceUrl=${encodedUrl}`;
fetch(apiUrl, {
method: 'GET'
}).catch(err => console.log('Background processing'));
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', processPage);
} else {
processPage();
}
})();
Simple URL Endpoint: https://intelligence.lsib.co.uk/IndexTitlesShortCourseV2?courseTitle=${courseTitle}&sourceUrl=${sourceUrl}
Supports both HTTP and HTTPS URLs
Test Endpoint: /IndexTitlesShortCourseV2?courseTitle=Test Course