We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d1baf7 commit ca40045Copy full SHA for ca40045
samples/twitterbuzz/src/twitterbuzz/core.cljs
@@ -85,14 +85,11 @@
85
(defn update-graph [graph tweet-maps]
86
(reduce (fn [acc tweet]
87
(let [user (:from_user tweet)
88
- mentions (parse-mentions tweet)]
89
- (-> (if-let [existing-node (get acc user)]
90
- (assoc acc user
91
- (assoc existing-node :last-tweet (:text tweet)))
92
93
- {:image-url (:profile_image_url tweet)
94
- :last-tweet (:text tweet)
95
- :mentions {}}))
+ mentions (parse-mentions tweet)
+ node (get acc user {:mentions {}})]
+ (-> (assoc acc user
+ (assoc node :last-tweet (:text tweet)
+ :image-url (:profile_image_url tweet)))
96
(add-mentions user mentions))))
97
graph
98
(map #(select-keys % [:text :from_user :profile_image_url]) tweet-maps)))
0 commit comments