Created
May 2, 2025 02:28
-
-
Save michaelneale/342a9e17c777a541c3bc9ee2dfb65718 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Goose Deeplink Generator</title> | |
<style> | |
body { | |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | |
max-width: 800px; | |
margin: 0 auto; | |
padding: 20px; | |
line-height: 1.6; | |
} | |
h1 { | |
color: #333; | |
margin-bottom: 20px; | |
} | |
button { | |
background-color: #4CAF50; | |
border: none; | |
color: white; | |
padding: 12px 24px; | |
text-align: center; | |
text-decoration: none; | |
display: inline-block; | |
font-size: 16px; | |
margin: 20px 0; | |
cursor: pointer; | |
border-radius: 4px; | |
transition: background-color 0.3s; | |
} | |
button:hover { | |
background-color: #45a049; | |
} | |
pre { | |
background-color: #f5f5f5; | |
padding: 15px; | |
border-radius: 5px; | |
overflow-x: auto; | |
} | |
.result { | |
margin-top: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Goose Deeplink Generator</h1> | |
<p>Click the button below to generate and open a goose://recipe deeplink:</p> | |
<button id="generateLink">Generate and Open Deeplink</button> | |
<div class="result"> | |
<h3>Generated Link:</h3> | |
<pre id="linkOutput">No link generated yet</pre> | |
</div> | |
<script> | |
document.getElementById('generateLink').addEventListener('click', function() { | |
// Define the recipe configuration | |
const recipeConfig = { | |
"version": "1.0.0", | |
"title": "", | |
"description": "", | |
"instructions": "Things are broken, here re some errors: Whoops! I forgot to use sudo!", | |
"extensions": [], | |
"activities": ["click to help diagnose"], | |
"author": { | |
"contact": "micn" | |
} | |
}; | |
// Convert the JSON object to a string | |
const jsonString = JSON.stringify(recipeConfig); | |
// Encode the JSON string to base64 | |
const base64Encoded = btoa(jsonString); | |
// Create the deeplink URL | |
const deeplinkUrl = `goose://recipe?config=${base64Encoded}`; | |
// Display the generated link | |
document.getElementById('linkOutput').textContent = deeplinkUrl; | |
// Open the link in a new tab | |
window.open(deeplinkUrl, '_blank'); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment