View source: R/osm_get_user_blocks.R
osm_get_user_blocks | R Documentation |
Read user block
osm_get_user_blocks(user_block_id, format = c("R", "xml", "json"))
user_block_id |
The id of the user block to retrieve represented by a numeric or a character value. |
format |
Format of the output. Can be |
If format = "R"
, returns a data frame with one row with the details of the block.
format = "xml"
Returns a xml2::xml_document with the following format:
<?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/"> <user_block id="101" created_at="2025-02-22T02:11:55Z" updated_at="2025-02-22T02:11:55Z" ends_at="2025-02-22T03:11:55Z" needs_view="true"> <user uid="5" user="fakemod1"/> <creator uid="115" user="fakemod2"/> </user_block> <user_block id="100" created_at="2025-02-22T02:11:10Z" updated_at="2025-02-22T02:11:10Z" ends_at="2025-02-22T02:11:10Z" needs_view="true"> <user uid="5" user="fakemod1"/> <creator uid="115" user="fakemod2"/> </user_block> ... </osm>
format = "json"
Returns a list with the following json structure:
{ "version":"0.6", "generator":"OpenStreetMap server", "copyright":"OpenStreetMap and contributors", "attribution":"http://www.openstreetmap.org/copyright", "license":"http://opendatacommons.org/licenses/odbl/1-0/", "user_blocks":[ { "id":101, "created_at":"2025-02-22T02:11:55Z", "updated_at":"2025-02-22T02:11:55Z", "ends_at":"2025-02-22T03:11:55Z", "needs_view":true, "user":{"uid":5,"user":"fakemod1"}, "creator":{"uid":115,"user":"fakemod2"}, "revoker":{"uid":115,"user":"fakemod2"}, "reason":"reason text\r\n\r\nmore reason text" }, { "id":100, "created_at":"2025-02-22T02:11:10Z", "updated_at":"2025-02-22T02:11:10Z", "ends_at":"2025-02-22T02:11:10Z", "needs_view":true, "user":{"uid":5,"user":"fakemod1"}, "creator":{"uid":115,"user":"fakemod2"}, "revoker":{"uid":115,"user":"fakemod2"}, "reason":"reason text\r\n\r\nmore reason text" }, ... ] }
Other user blocks' functions:
osm_create_user_block()
,
osm_list_active_user_blocks()
osm_get_user_blocks(1:2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.