Skip to content

Instantly share code, notes, and snippets.

@thebentern
Created February 12, 2025 17:03
Show Gist options
  • Save thebentern/294ff2072a0f0a920ff8a7f79c884144 to your computer and use it in GitHub Desktop.
Save thebentern/294ff2072a0f0a920ff8a7f79c884144 to your computer and use it in GitHub Desktop.
Generate FREQMAN text file from RadioReference.com table
// Run in the dev console of your browser on the page
// eg. https://www.radioreference.com/db/browse/ctid/167/all
let fileContent = ''
$('tr').each((index, tr) => {
// Skip header
if (index > 0) {
const freq = $(tr).find('td').eq(0).text().replace('.', '').substring(0, 9)
const description = $(tr).find('td').eq(4).text()
fileContent += `f=${freq}, d=${description}\n`
}
})
function downloadTextFile(text, filename) {
const blob = new Blob([text], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = filename;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
}
const fileName = "freqs.txt";
downloadTextFile(fileContent, fileName);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment