You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As Mastodon uses Snowflake IDs for statuses, it is possible to convert a date and time to a Snowflake ID (with a relatively low resolution). Giving users the ability to provide a POSIXct for max_id, min_id, and/or since_id could make it easier to search for posts between two dates/times.
One way to implement this could be changing handle_params in utils. Converting a POSIXct datetime to a snowflake id can by done by bitshifting the timestamp like this: as.numeric(datetime)*(2^16))*1000
Might make sense to do a is(max_id, "POSIXct") check before converting, like so:
handle_id<-function(x) {
## convert x to snowflake id if it is POSIXctif (is (x, "POSIXct")) {
return(as.numeric(x)*(2^16))*1000)
}
x
}
if (!missing(max_id)) {
params$max_id<- handle_id(max_id)
}
As Mastodon uses Snowflake IDs for statuses, it is possible to convert a date and time to a Snowflake ID (with a relatively low resolution). Giving users the ability to provide a POSIXct for max_id, min_id, and/or since_id could make it easier to search for posts between two dates/times.
The Python API client does this as well (and I found it very useful!): https://mastodonpy.readthedocs.io/en/stable/01_general.html#snowflake-ids
One way to implement this could be changing
handle_params
in utils. Converting a POSIXct datetime to a snowflake id can by done by bitshifting the timestamp like this:as.numeric(datetime)*(2^16))*1000
Might make sense to do a
is(max_id, "POSIXct")
check before converting, like so:The text was updated successfully, but these errors were encountered: