Just a quick script to search FCC's the license database and check whether my amateur radio license has appeared yet.
Requires terminal-notifier.
Docs for this API are here.
The plist goes in your ~/Library/LaunchAgents/.
| 6be5d57c4d0c622216b38c5ea62195a5 |
Just a quick script to search FCC's the license database and check whether my amateur radio license has appeared yet.
Requires terminal-notifier.
Docs for this API are here.
The plist goes in your ~/Library/LaunchAgents/.
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.cdzombak.watch-for-my-ham-license</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/Users/chris/code/watch-for-my-ham-license.sh</string> | |
| </array> | |
| <key>RunAtLoad</key> | |
| <true/> | |
| <key>StartInterval</key> | |
| <integer>600</integer> | |
| <key>WatchPaths</key> | |
| <array> | |
| <string>/Users/chris/.last-uls-search-hash</string> | |
| </array> | |
| </dict> | |
| </plist> | |
| <!-- @@@@LingonWhatStart:/Users/chris/code/watch-for-my-ham-license.sh@@@@LingonWhatEnd --> |
| #!/bin/bash | |
| LAST_HASH=`cat $HOME/.last-uls-search-hash` | |
| NOW_HASH=`curl -s -o - "http://data.fcc.gov/api/license-view/basicSearch/getLicenses?searchValue=dzombak&format=json" | md5` | |
| if [ $LAST_HASH != $NOW_HASH ]; then | |
| /Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier -message "The ULS DB search results for 'dzombak' have changed." -open "http://wireless2.fcc.gov/UlsApp/UlsSearch/searchAmateur.jsp" -title "ULS DB Search Results" | |
| echo "$NOW_HASH" > $HOME/.last-uls-search-hash | |
| fi |