Added --no-tweeing flag.

This commit is contained in:
John Wiseman 2019-12-14 10:20:42 -08:00
parent 7a5db5ab19
commit f9f689828b
2 changed files with 7 additions and 6 deletions

View File

@ -370,11 +370,11 @@
description))])
(fn [[image-path description]]
(if (and image-path description)
(if (:twitter config)
(if (and (:tweeting-enabled? config) (:twitter config))
(twitter/tweet (twitter/twit (:twitter config))
description
[image-path])
(log-warn "Skipping tweeting: No twitter config provided"))
(log-warn "Skipping tweeting"))
(log-warn "Skipping tweet %s %s" image-path description)))))))))))
@ -395,14 +395,15 @@
(.requiredOption "--lat <lat>" "Latitude of the circle of region of interest" parse-number)
(.requiredOption "--lon <lat>" "Longitude of the circle of the region of interest" parse-number)
(.requiredOption "--url <url>" "API url")
(.option "--queue <queue url>" "Queue URL (graphile)")
(.option "--radius <radius>" "Radius of the circle of interest, in nautical miles" 20 parse-number)
(.option "--no-tweeting" "Do not tweet.")
(.parse (.-argv js/process)))
(let [start-time (current-time)]
(p/then (p/all [(read-history-db history-db-path)
(util/read-config secrets-path)])
(fn [[db config]]
(p/let [data (get-adsbexchange-live-data
(p/let [config (assoc config :tweeting-enabled? (.-tweeting commander))
data (get-adsbexchange-live-data
{:url (.-url commander)
:api-key (get-in config [:adsbx :api-key])
:lat (.-lat commander)

View File

@ -75,8 +75,8 @@
(nil? bearing))
(defn spurious-bearing-diff [^double bearing]
(> (Math/abs bearing) 160))
(defn spurious-bearing-diff [^double bearing-diff]
(> (Math/abs bearing-diff) 160))
(defn curviness