Added --no-tweeing flag.
This commit is contained in:
parent
7a5db5ab19
commit
f9f689828b
@ -370,11 +370,11 @@
|
|||||||
description))])
|
description))])
|
||||||
(fn [[image-path description]]
|
(fn [[image-path description]]
|
||||||
(if (and image-path description)
|
(if (and image-path description)
|
||||||
(if (:twitter config)
|
(if (and (:tweeting-enabled? config) (:twitter config))
|
||||||
(twitter/tweet (twitter/twit (:twitter config))
|
(twitter/tweet (twitter/twit (:twitter config))
|
||||||
description
|
description
|
||||||
[image-path])
|
[image-path])
|
||||||
(log-warn "Skipping tweeting: No twitter config provided"))
|
(log-warn "Skipping tweeting"))
|
||||||
(log-warn "Skipping tweet %s %s" image-path description)))))))))))
|
(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 "--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 "--lon <lat>" "Longitude of the circle of the region of interest" parse-number)
|
||||||
(.requiredOption "--url <url>" "API url")
|
(.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 "--radius <radius>" "Radius of the circle of interest, in nautical miles" 20 parse-number)
|
||||||
|
(.option "--no-tweeting" "Do not tweet.")
|
||||||
(.parse (.-argv js/process)))
|
(.parse (.-argv js/process)))
|
||||||
(let [start-time (current-time)]
|
(let [start-time (current-time)]
|
||||||
(p/then (p/all [(read-history-db history-db-path)
|
(p/then (p/all [(read-history-db history-db-path)
|
||||||
(util/read-config secrets-path)])
|
(util/read-config secrets-path)])
|
||||||
(fn [[db config]]
|
(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)
|
{:url (.-url commander)
|
||||||
:api-key (get-in config [:adsbx :api-key])
|
:api-key (get-in config [:adsbx :api-key])
|
||||||
:lat (.-lat commander)
|
:lat (.-lat commander)
|
||||||
|
@ -75,8 +75,8 @@
|
|||||||
(nil? bearing))
|
(nil? bearing))
|
||||||
|
|
||||||
|
|
||||||
(defn spurious-bearing-diff [^double bearing]
|
(defn spurious-bearing-diff [^double bearing-diff]
|
||||||
(> (Math/abs bearing) 160))
|
(> (Math/abs bearing-diff) 160))
|
||||||
|
|
||||||
|
|
||||||
(defn curviness
|
(defn curviness
|
||||||
|
Loading…
Reference in New Issue
Block a user