• Resolved aaribaud

    (@aaribaud)


    [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 1 year, 2 months ago by aaribaud.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Wolfgang

    (@wolfgang101)

    Hi @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

    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

    (@aaribaud)

    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 1 year, 2 months ago by aaribaud.
    Plugin Author Wolfgang

    (@wolfgang101)

    /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 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

    (@aaribaud)

    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

    (@wolfgang101)

    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.