Title: Filter by post/edit date?
Last modified: July 8, 2023

---

# Filter by post/edit date?

 *  Resolved [aaribaud](https://wordpress.org/support/users/aaribaud/)
 * (@aaribaud)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/filter-by-post-edit-date/)
 * [EDIT: apparently the date options are about how dates are displayed, not about
   filtering by date]
 * Hello,
 * Judging from the source code, it seems ~there are date filtering options available,
   but apparently they cannot be used from the shortcode~ there is no way to limit
   by start and end date.
 * I am interested in such a feature, for monthly themed micro-fiction writing challenges)
 * Is someone already working on this?
 * If not, then I am willing to work on it.
    -  This topic was modified 2 years, 11 months ago by [aaribaud](https://wordpress.org/support/users/aaribaud/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Wolfgang](https://wordpress.org/support/users/wolfgang101/)
 * (@wolfgang101)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/filter-by-post-edit-date/#post-16880225)
 * Hi [@aaribaud](https://wordpress.org/support/users/aaribaud/) – thanks for your
   feedback. Can you describe the desired behavior in more detail?
 * The plugin uses the accounts/statuses API call which does not require authentication,
   but sadly does not support timestamps: [https://docs.joinmastodon.org/methods/accounts/#statuses](https://docs.joinmastodon.org/methods/accounts/#statuses)
   
   It would be easy to implement a filter but the filter can only be applied to 
   the latest posts and we are not able to fetch past posts by timestamp.
 *  Thread Starter [aaribaud](https://wordpress.org/support/users/aaribaud/)
 * (@aaribaud)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/filter-by-post-edit-date/#post-16881088)
 * Hi Wolfgang,
 * My need would be to fetch posts from the public timeline of my own account, filtering
   by some hashtag (or the hashtag’s public timeline, filtering by author) between
   two dates.
 * This should be doable with the /statuses endpoint, using min_id and max_id in
   the request, as these seem to be the only way to specify a timestamp interval.
 * I’ll try and create (and test) a PoC branch.
    -  This reply was modified 2 years, 11 months ago by [aaribaud](https://wordpress.org/support/users/aaribaud/).
 *  Plugin Author [Wolfgang](https://wordpress.org/support/users/wolfgang101/)
 * (@wolfgang101)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/filter-by-post-edit-date/#post-16881204)
 * `/api/v1/accounts/:id/statuses` returns the last public 20 tweets of the given
   account. Filtering by hashtags or any content within those statuses is quite 
   straight forward.
 * This plugin focuses on one narrow use case: to fetch the latest posts of a single
   users public timeline, without the need for OAuth credentials/Auth tokens.
 * There is also [https://github.com/stefanbohacek/fediverse-embeds-wordpress-plugin](https://github.com/stefanbohacek/fediverse-embeds-wordpress-plugin)
   that fetches and stores data locally. It might be a better fit to build upon.
   The server-side approach would also make sure that not every visitor pulls the
   instance API too often.
 * Looking forward to hear about your PoC results.
 *  Thread Starter [aaribaud](https://wordpress.org/support/users/aaribaud/)
 * (@aaribaud)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/filter-by-post-edit-date/#post-16881561)
 * The `/api/v1/accounts/:id/statuses` endpoint would be fine for my purpose, as
   it honors min_id and max_id and would thus allow fetching the messages from a
   whole month period, and the most I would fetch would be 31 posts (1 per day).
 * But you’re right that it would then fetch ~30 posts every time the page is read(
   and it would not be read frequently enough for caching to be efficient).
 * The embeds plugin might be part of a solution, though. Thanks for pointing this
   to me!
 *  Plugin Author [Wolfgang](https://wordpress.org/support/users/wolfgang101/)
 * (@wolfgang101)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/filter-by-post-edit-date/#post-16881619)
 * I do love technical challenges and thinking about an approach would be to create
   a local php plugin file that acts as proxy for the api calls that also handles
   local caching.
 * The plugin code then just calls the local proxy file with the same params as 
   it used to. Looping with min_id and max_id could be handled inside the proxy 
   file so that the browser still only makes one single call.
 * Really like that this would move almost all API calls to the local server, but
   not sure if I’ll tackle that any time soon. Would prefer to keep the plugin simpler
   without any local caching for the time being.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Filter by post/edit date?’ is closed to new replies.

 * ![](https://ps.w.org/include-mastodon-feed/assets/icon.svg?rev=2828003)
 * [Include Mastodon Feed](https://wordpress.org/plugins/include-mastodon-feed/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/include-mastodon-feed/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/include-mastodon-feed/)
 * [Active Topics](https://wordpress.org/support/plugin/include-mastodon-feed/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/include-mastodon-feed/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/include-mastodon-feed/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Wolfgang](https://wordpress.org/support/users/wolfgang101/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/filter-by-post-edit-date/#post-16881619)
 * Status: resolved