Add link to tar1090.adsbexchange.com in tweets.

This commit is contained in:
John Wiseman 2020-01-07 15:22:06 -08:00
parent 041c07e782
commit 4c2786ce56
2 changed files with 4 additions and 4 deletions

View File

@ -287,7 +287,8 @@
"?:[speed {speed} MPH, ]" "?:[speed {speed} MPH, ]"
"?:[squawking {squawk}, ]" "?:[squawking {squawk}, ]"
"?:[{nearbydistance} miles from {nearbylandmark} ]" "?:[{nearbydistance} miles from {nearbylandmark} ]"
"?:[#{registration}|#{militaryregistration}]")])) "?:[#{registration} |#{militaryregistration} ]"
"https://tar1090.adsbexchange.com/?icao={icao}&zoom=13")]))
(defn expand-template [data] (defn expand-template [data]
(let [results (take 3 (generation/expand (let [results (take 3 (generation/expand
@ -418,7 +419,6 @@
(get-basestation-sqb-record icao sqb-path))] (get-basestation-sqb-record icao sqb-path))]
(log-info "%s: Nearby geo search: %s potential landmarks, %s with wikipedia pages" (log-info "%s: Nearby geo search: %s potential landmarks, %s with wikipedia pages"
icao (count nearby) (count wiki-nearby)) icao (count nearby) (count wiki-nearby))
(log-info "%s" (->> nearby (take 3) (map :properties)))
(log-info "Nearest venues:") (log-info "Nearest venues:")
(log-table (->> nearby (take 3) (map :properties)) (log-table (->> nearby (take 3) (map :properties))
[:distance :label :locality :neighborhood :county :gid]) [:distance :label :locality :neighborhood :county :gid])

View File

@ -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"}] (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)))) (is (re-find #"military" (-> (circlebot/expand-template data) :text))))
(testing "a vs. an for type" (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))))) (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))))))) (is (re-find #"a Yoyo" (:text (circlebot/expand-template data)))))))