Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Friday, July 11, 2008

More AMSAT Website Hacking

AMSAT has a page that predicts satellite passes. My problem with it is that it lists ALL of the passes, including ones that just graze the horizon. I generally tend to avoid them.

The following bookmarklet clears out all passes from the table of results that are less than 30 degrees above the horizon. Go to the AMSAT Prediction and get a list of passes for a satellite. Then paste the following code in your browser's address window and tell it to go. It should shorten the table.

***UPDATE - An error crept in when I posted this before...I had the row variable running to row <= table5.rows.length, and it ran over the end of the table, giving errors. The version below seems to work better.

***UPDATE - Added a prompt for the minimum elevation.

javascript:(function(){var minElev=Number(prompt("Minimum Elevation","30"));var table5=document.getElementsByTagName('table')[5];var row=2;while(row<table5.rows.length){if(table5.rows[row].cells[4].innerText<minElev){table5.deleteRow(row);}else{row=row+1;}}})()

It works in IE 6 and Firefox 2.0.0.15.

Friday, June 27, 2008

Hacking AMSAT's Website

AMSAT has a nice web site, full of information on amateur radio satellites, tools for tracking them, news, etc.
My gripe with the site has to do with the page style. The background image is something called "flannel", which is a bunch of fine black stripes on a white background. For me, it is too much white. To make matters worse, on some monitors, the stripes do some sort of flickering. Not Moire lines, but flickering, probably due to some video card setting I have wrong.
Rather than impose my tastes on others, I wrote a goofy little Greasemonkey script to change the background:

// ==UserScript==
// @name BlueAmsat
// @namespace http://userscripts.org/users/57521
// @description Change the AMSAT default background to blue
// @include http://www.amsat.org/*
// ==/UserScript==
document.body.style.backgroundImage = "none";
document.body.style.background = "darkblue";

You can install it directly here