Website Parsing
Parsing a website URL to redirect to the Newo.ai Agent Creator is an alternative to the Google Places Picker widget. Instead of a Google Maps location, you can enter a website, and the Agent Creator will scrape it for context information to build an agent.
Here is the website link you'd parse:
https://agent.newo.ai/creator?source=${websiteUrl}&source_type=website
You can optionally include a referral parameter, allowing you to track referrals for your agents:
https://agent.newo.ai/creator?source=${websiteUrl}&source_type=website&[email protected]
Example Implementation
Below is a complete example of how you would implement the website parsing field on your website:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Website URL Input</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f8f9fa;
margin: 0;
}
.container {
display: flex;
gap: 0.5rem;
padding: 1rem;
background: white;
border-radius: 0.5rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.input {
flex: 1;
padding: 0.5rem;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 0.25rem;
outline: none;
}
.button {
padding: 0.5rem 1rem;
background-color: #007bff;
color: white;
text-decoration: none;
border: none;
border-radius: 0.25rem;
cursor: pointer;
font-size: 1rem;
display: flex;
align-items: center;
justify-content: center;
}
.button:disabled {
background-color: #6c757d;
cursor: not-allowed;
}
</style>
</head>
<body>
<div class="container">
<input
type="text"
id="website-input"
class="input"
placeholder="Enter website URL (e.g., https://example.com)"
/>
<a class="button" href="#" id="link" target="_blank" disabled>Go</a>
</div>
<script>
const websiteInput = document.getElementById('website-input');
const link = document.getElementById('link');
function isValidUrl(string) {
try {
new URL(string);
return true;
} catch (_) {
return false;
}
}
websiteInput.addEventListener('input', () => {
const websiteUrl = websiteInput.value.trim();
if (isValidUrl(websiteUrl)) {
link.href = `https://agent.newo.ai/creator?source=${websiteUrl}&source_type=website`;
link.removeAttribute('disabled');
} else {
link.href = "#";
link.setAttribute('disabled', 'true');
}
});
</script>
</body>
</html>
Updated about 1 month ago