Closed rempsyc closed 1 year ago
From: https://docs.joinmastodon.org/methods/statuses/#boost
Boost a status
POST /api/v1/statuses/:id/reblog HTTP/1.1
Reshare a status on your own profile.
What I've tried:
library(rtoot)
post_id <- 110618427914578591
boost_endpoint <- paste0("api/v1/statuses/", post_id, "/reblog")
boost_endpoint
#> [1] "api/v1/statuses/110618427914578592/reblog"
boost_response <- rtoot(boost_endpoint, method = "POST")
#> Error: something went wrong. Status code: 404
boost_response <- rtoot(boost_endpoint, method = "HTTP/1.1")
#> Error: something went wrong. Status code: 404
404: Not found
Status does not exist or is private
{
"error": "Record not found"
}
But trying the get_status()
example I am getting the same error:
get_status(id = "109298295023649405")
#> Error: something went wrong. Status code: 404
get_reblogged_by(id = "109294719267373593")
#> Error: something went wrong. Status code: 404
get_favourited_by(id = "109294719267373593")
#> Error: something went wrong. Status code: 404
The example in get_status()
seemed broken. I fixed that.
I also added post_status
which works similar to post_user
to favourite/reblog/bookmark statuses. So you can boost now :)
Wow, awesome, that was quick! 😮😃
You got me exactly on my monthly dev day 😉
Some more work for you, for next monthly dev day perhaps :P
library(rtoot)
# Works on same instance
post_id <- 110635249481533536
post_status(post_id)
#> successfully performed action on status
# Fails with no message on other instance
post_id <- 110618427914578591
post_status(post_id)
# Unused argument 'instance' like for `get_status()`
post_status(post_id, instance = "mastodon.world")
#> Error in post_status(post_id, instance = "mastodon.world"): unused argument (instance = "mastodon.world")
Created on 2023-06-30 with reprex v2.0.2
Welcome to the Fediverse
Hi, it would be nice if we could boost toots with the
rtoot
package, say with aboost_toot()
function.Is there already a way to do this through an existing function?