Giter Site home page Giter Site logo

aistropoalert's Issues

[ not a bug ] just suggestion

Hi,

I modified the script to add:
-shipname if available
-bearing
and to have variables in uppercase.

Here are examples:

./AISTropoAlert.sh 
Furthest ship MMSI:246436000 SHIPNAME:"DUTCH EMERALD" bearing:289 seen was 117.997429 miles away further than 30 miles away!

$ ./AISTropoAlert.sh 
Furthest ship MMSI:310825000 bearing:12 seen was 92.069016 miles away further than 30 miles away!

Here the lines modifed:

MAXDIST=`curl -s $URL/ships.json  | jq --arg dist $DIST  '.ships[] | select(.distance>=($dist|tonumber)) | .distance' | sort -nr | head -1 `
#echo " maxdist $MAXDIST "

#curl -s $URL/ships.json | jq  '.ships[] | select(.distance>=61.497009)| .mmsi'|sort -nr | head -1
MMSI=` curl -s $URL/ships.json  | jq --arg maxdist $MAXDIST '.ships[] | select(.distance>=($maxdist|tonumber))| .mmsi'`
#echo " mmsi $MMSI"

SHIPNAME=` curl -s $URL/ships.json  | jq --arg maxdist $MAXDIST '.ships[] | select(.distance>=($maxdist|tonumber))| .shipname'`
#echo " shipname <$SHIPNAME>"

BEARING=` curl -s $URL/ships.json  | jq --arg maxdist $MAXDIST '.ships[] | select(.distance>=($maxdist|tonumber))| .bearing'`
if [ "$SHIPNAME" == '""' ]
then
        echo Furthest ship MMSI:$MMSI bearing:$BEARING seen was $MAXDIST miles away further than $DIST miles away!
else
        echo Furthest ship MMSI:$MMSI SHIPNAME:$SHIPNAME bearing:$BEARING seen was $MAXDIST miles away further than $DIST miles away!

fi

regards
Phil

Nice app, I’m considering integrating this with VesselAlert

Hi there,

I came across your short script/app via the AisCatcher website. Great idea! I’m considering to incorporate it into my vessel notification app/container called VesselAlert , of course with proper attributions under your GPL license. One of the improvements I’m thinking of is to keep a rolling (12-hour for example) max distance and only send a notification if the actual distance is > minimum distance and if it’s at least (say) 25 nm further than the last measured max distance. That way the notifications can be limited to only meaningful ones.

This would be a great add to VesselAlert and easy to implement as I already have Mastodon and Discord notifications. (See for example https://airwaves.social/@bostonharbor )

Thanks again; feel free to close this (non-) issue after you read it.

Ramon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.