Skip to content

Commit

Permalink
Revised condition to detect shared publications (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
revue-de-presse authored Jul 15, 2023
1 parent 6cf3a5d commit 4692df0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 7 additions & 4 deletions src/command/save_highlights.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@
(try
(let [api-document (:api-document document)
decoded-document (json/read-str api-document)
retweet-publication-date-time (if (some? (get decoded-document "retweeted_status"))
(get (get decoded-document "retweeted_status") "created_at")
nil)
retweet-publication-date-time (cond
(some? (get decoded-document "retweeted_status")) (get (get decoded-document "retweeted_status") "created_at")
(some? (get decoded-document "retweeted_status_result")) (get (get decoded-document "retweeted_status_result") "created_at")
:else nil)
highlight-props {:id (uuid/v1)
:member-id (:member-id document)
:status-id (:status-id document)
:aggregate-id (:id aggregate)
:aggregate-name (:name aggregate)
:is-retweet (some? (get decoded-document "retweeted_status"))
:is-retweet (or
(some? (get decoded-document "retweeted_status"))
(some? (get decoded-document "retweeted_status_result")))
:publication-date-time (:publication-date-time document)
:retweeted-status-publication-date (if (some? retweet-publication-date-time)
(c/to-timestamp
Expand Down
4 changes: 0 additions & 4 deletions src/twitter/api_client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,6 @@
(do
(try
(let [fallback-token @next-token
props-or-status-id (if
(nil? (:status-id props))
(:status-id props)
props)
bearer-token (str "Bearer " (:bearer-token env))
variables (json/write-str {"focalTweetId" status-id
"with_rux_injections" false
Expand Down

0 comments on commit 4692df0

Please sign in to comment.