Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
watching for my amateur radio license to appear in the FCC's database!
6be5d57c4d0c622216b38c5ea62195a5
<?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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment