Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Reverse order of tweets posted #27

Closed
marians opened this issue Nov 19, 2019 · 5 comments
Closed

Reverse order of tweets posted #27

marians opened this issue Nov 19, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@marians
Copy link

marians commented Nov 19, 2019

Thanks for mastodon-bot!

I noticed that when posting multiple tweets to Mastodon, the most recent tweet is posted first and the oldest is posted last, resulting in a reverse ordering.

How little work would it be to reverse the ordering of the twitter feed before processing it?

Unfortunately I have zero insights in Clojure development, so I am not able to solve this issue on my own.

@yogthos yogthos added the enhancement New feature or request label Nov 20, 2019
@yogthos
Copy link
Owner

yogthos commented Nov 20, 2019

Ah, I think it should just be a matter of doing reverse in the post-itmes function:

(defn post-items [last-post-time items]
  (doseq [{:keys [text media-links]} (->> items
                                          (remove #(blocked-content? (:text %)))
                                          (filter #(> (:created-at %) last-post-time))
                                          (reverse))] ;; reverse the items
    (if media-links
      (post-status-with-images text media-links)
      (when-not (:media-only? mastodon-config)
        (post-status text)))))

Let me know if that does the trick.

@marians
Copy link
Author

marians commented Nov 21, 2019

Thanks! I'll try that on the next occasion and if it works, I'll send a PR.

@yogthos
Copy link
Owner

yogthos commented Nov 21, 2019

👍

@marians
Copy link
Author

marians commented Nov 23, 2019

Dev question: How do I update the compiled mastodon-bot.js file?

@yogthos
Copy link
Owner

yogthos commented Nov 24, 2019

Ah, I haven't checked that part in. You have to run the ClojureScript compiler for that, I'll that part in. I use the cljs version myself via Lumo.

@yogthos yogthos closed this as completed Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants