Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APRS API demo #17

Open
cmdcolin opened this issue Jun 22, 2016 · 1 comment
Open

APRS API demo #17

cmdcolin opened this issue Jun 22, 2016 · 1 comment

Comments

@cmdcolin
Copy link
Collaborator

I made this APRS API demo awhile back. Could be used for fun and or profit

<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script>


// call the api and update 
for(var i=0; i<5; i++) {
    setTimeout(function() {
        // aprs.fi doesn't appear to support CORS so use jsonp proxy
        var myquery = encodeURIComponent('select * from json where url="http://api.aprs.fi/api/get?name=KE0BVB-11&what=loc&apikey=76956.nqwpsBsmbGoBC&format=json"');
        $.ajax({
            method: 'GET',
            url: 'http://query.yahooapis.com/v1/public/yql?q='+ myquery +'&format=json&callback=?',
            dataType: 'jsonp',
            success: function(data) {
                var entry = data.query.results.json.entries;
                $('p').append(entry.altitude+"<br/>");

                //ideas: 
                //put little balloon on screen,y-coordinate is proportional to altitude
            }
        });
    }, i*5000);
}


</script>
<title>Balloons!</title>
</head>
<body>
<h3>Altitudes from aprs.fi</h3>
<p></p>
</body>
</html>
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Jun 22, 2016

It seems to have to use JSONP via yahoo proxy since aprs doesn't accept cross-origin requests directly, but haven't validated that completely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant