Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistency between get_instance_rules and get_instance_general #132

Closed
marcohhu opened this issue May 31, 2023 · 2 comments
Closed

inconsistency between get_instance_rules and get_instance_general #132

marcohhu opened this issue May 31, 2023 · 2 comments
Assignees

Comments

@marcohhu
Copy link

Hello,

there seems to be inconsistency between the above functions. Let us try get_instance_rules to get the rules of a particular instance:

library(rtoot)
get_instance_rules("pixey.org")
#> Error: something went wrong. Status code: 404

status code 404 occurs.

While using get_instance_general() works fine. And you get the instance rule from the output

get_instance_general("pixey.org")$rules
#> [[1]]
#> [[1]]$id
#> [1] "1"
#> 
#> [[1]]$text
#> [1] "Sexually explicit or violent media must be marked as sensitive when posting."
#> 
#> 
#> [[2]]
#> [[2]]$id
#> [1] "2"
#> 
#> [[2]]$text
#> [1] "No racism, sexism, homophobia, transphobia, xenophobia, or casteism."
#> 
#> 
#> [[3]]
#> [[3]]$id
#> [1] "3"
#> 
#> [[3]]$text
#> [1] "No incitement of violence or promotion of violent ideologies."
#> 
#> 
#> [[4]]
#> [[4]]$id
#> [1] "4"
#> 
#> [[4]]$text
#> [1] "No illegal content.

Everythink works well for other instances, e.g. mastodon.social

library(rtoot)
get_instance_rules("mastodon.social")
#> # A tibble: 5 × 2
#>   id    text                                                                    
#>   <chr> <chr>                                                                   
#> 1 1     Sexually explicit or violent media must be marked as sensitive when pos…
#> 2 2     No racism, sexism, homophobia, transphobia, xenophobia, or casteism     
#> 3 3     No incitement of violence or promotion of violent ideologies            
#> 4 4     No harassment, dogpiling or doxxing of other users                      
#> 5 7     Do not share intentionally false or misleading information
get_instance_general("mastodon.social")$rules
#> [[1]]
#> [[1]]$id
#> [1] "1"
#> 
#> [[1]]$text
#> [1] "Sexually explicit or violent media must be marked as sensitive when posting"
#> 
#> 
#> [[2]]
#> [[2]]$id
#> [1] "2"
#> 
#> [[2]]$text
#> [1] "No racism, sexism, homophobia, transphobia, xenophobia, or casteism"
#> 
#> 
#> [[3]]
#> [[3]]$id
#> [1] "3"
#> 
#> [[3]]$text
#> [1] "No incitement of violence or promotion of violent ideologies"
#> 
#> 
#> [[4]]
#> [[4]]$id
#> [1] "4"
#> 
#> [[4]]$text
#> [1] "No harassment, dogpiling or doxxing of other users"
#> 
#> 
#> [[5]]
#> [[5]]$id
#> [1] "7"
#> 
#> [[5]]$text
#> [1] "Do not share intentionally false or misleading information"
packageVersion("rtoot")
#> [1] '0.3.0'
R.version
#>                _                                
#> platform       x86_64-w64-mingw32               
#> arch           x86_64                           
#> os             mingw32                          
#> crt            ucrt                             
#> system         x86_64, mingw32                  
#> status                                          
#> major          4                                
#> minor          3.0                              
#> year           2023                             
#> month          04                               
#> day            21                               
#> svn rev        84292                            
#> language       R                                
#> version.string R version 4.3.0 (2023-04-21 ucrt)
#> nickname       Already Tomorrow

I have not been able to see a pattern yet, but the problem is not limited to a single instance. However, I noticed the problem rather by chance.

@schochastics
Copy link
Member

interesting catch. Weirdly enough, this works, which is essentially the same call

rtoot::rtoot("/api/v1/instance/rules",params = list(instance="pixey.org"))

I will dig into that

@schochastics
Copy link
Member

get_instance_rules now calls get_instance_general to get the rules. Seemed to be the most straightforward fix since I could not find the issue with the rules endpoint. Closing this now but @marcohhu feel free to reopen if the issue persists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants