Skip to content

Instantly share code, notes, and snippets.

@AugustMiller
Created March 25, 2025 18:28
Show Gist options
  • Save AugustMiller/49c2d0c0e296ebcfe377c1719a2f01d6 to your computer and use it in GitHub Desktop.
Save AugustMiller/49c2d0c0e296ebcfe377c1719a2f01d6 to your computer and use it in GitHub Desktop.
Raycast Script for fetching callsigns from Hamcall.dev
#!/usr/bin/env node
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title Callsign
// @raycast.mode compact
// @raycast.argument1 { "type": "text", "placeholder": "ID" }
// Optional parameters:
// @raycast.icon 📡
// Documentation:
// @raycast.description Get information about a callsign.
// @raycast.author August Miller
const sign = process.argv.slice(2)[0];
fetch(`https://hamcall.dev/${sign}.json`)
.then(function(response) {
return response.json();
})
.then(function(json) {
if (json.status === 404) {
throw `Could’t find callsign “${sign}”`;
}
const data = [
json.name,
json.class,
`${json.city}, ${json.state}`,
];
console.log(data.join(' / '));
})
.catch(function(err) {
console.error(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment