Add link to tar1090.adsbexchange.com in tweets.
This commit is contained in:
parent
041c07e782
commit
4c2786ce56
@ -287,7 +287,8 @@
|
||||
"?:[speed {speed} MPH, ]"
|
||||
"?:[squawking {squawk}, ]"
|
||||
"?:[{nearbydistance} miles from {nearbylandmark} ]"
|
||||
"?:[#{registration}|#{militaryregistration}]")]))
|
||||
"?:[#{registration} |#{militaryregistration} ]"
|
||||
"https://tar1090.adsbexchange.com/?icao={icao}&zoom=13")]))
|
||||
|
||||
(defn expand-template [data]
|
||||
(let [results (take 3 (generation/expand
|
||||
@ -418,7 +419,6 @@
|
||||
(get-basestation-sqb-record icao sqb-path))]
|
||||
(log-info "%s: Nearby geo search: %s potential landmarks, %s with wikipedia pages"
|
||||
icao (count nearby) (count wiki-nearby))
|
||||
(log-info "%s" (->> nearby (take 3) (map :properties)))
|
||||
(log-info "Nearest venues:")
|
||||
(log-table (->> nearby (take 3) (map :properties))
|
||||
[:distance :label :locality :neighborhood :county :gid])
|
||||
|
@ -100,9 +100,9 @@
|
||||
(let [data {:locality "Palmdale", :continent "North America", :military? true, :alt 3200, :speed "161", :normalized-curviness 15.783422690487765, :accuracy "centroid", :country_a "USA", :continent_gid "whosonfirst:continent:102191575", :name "Palmdale", :squawk "5330", :icao "AE1482", :county_a "LO", :county "Los Angeles County", :source "whosonfirst", :gid "whosonfirst:locality:85923493", :curviness 1098.803548060181, :locality_gid "whosonfirst:locality:85923493", :region "California", :militaryicao "AE1482", :region_a "CA", :nearbydistance 7.828, :callsign "RAIDR49", :layer "locality", :mlat? false, :country_gid "whosonfirst:country:85633793", :label "Palmdale, CA, USA", :id "85923493", :lon -118.049183, :region_gid "whosonfirst:region:85688637", :lat 34.649808, :militaryregistration "166765", :county_gid "whosonfirst:county:102086957", :started-circling-time 1576267564959, :distance 6.336, :source_id "85923493", :registration "166765", :confidence 0.5, :country "United States", :postime 1576267555709, :nearbylandmark "Living Faith Foursquare Church"}]
|
||||
(is (re-find #"military" (-> (circlebot/expand-template data) :text))))
|
||||
(testing "a vs. an for type"
|
||||
(let [data {:registration "TEST" :type "Airbus 380" :locality "Test City"}]
|
||||
(let [data {:registration "TEST" :icao "123" :type "Airbus 380" :locality "Test City"}]
|
||||
(is (re-find #"an Airbus" (:text (circlebot/expand-template data)))))
|
||||
(let [data {:registration "TEST" :type "Yoyo 380" :locality "Test City"}]
|
||||
(let [data {:registration "TEST" :icao "123" :type "Yoyo 380" :locality "Test City"}]
|
||||
(is (re-find #"a Yoyo" (:text (circlebot/expand-template data)))))))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user