paleolimbot / rbbt

R Interface to the Better BiBTex Zotero Connector
145 stars 26 forks source link

Can bbt_write_bib work for Group Libraries in Zotero? #10

Closed j-harbin closed 4 years ago

j-harbin commented 4 years ago

Good afternoon,

This is a great package you have created! I was wondering if it possible to use the bbt_write_bib function for a Group Library in Zotero? If so, could you please explain how I would specify the library_id? Right now I seem to only be able to use bbt_write_bib for references in "My Library".

Thanks in advance for your help

paleolimbot commented 4 years ago

I think you can set the library_id argument in bbt_write_bib(), which defaults to 1 (always the ID of My Library). You can query the IDs and names of your libraries using:

rbbt::bbt_call_json_rpc("user.groups")
#> $jsonrpc
#> [1] "2.0"
#> 
#> $result
#> $result[[1]]
#> $result[[1]]$id
#> [1] 1
#> 
#> $result[[1]]$name
#> [1] "My Library"
#> 
#> 
#> $result[[2]]
#> $result[[2]]$id
#> [1] 3
#> 
#> $result[[2]]$name
#> [1] "acadialimlab"
#> 
#> 
#> 
#> $id
#> NULL

Created on 2020-09-04 by the reprex package (v0.3.0)

I don't seem to be able to specify a string as the library ID, so you probably have to query this and use the numeric ID.

j-harbin commented 4 years ago

I can confirm that this worked. Thank you for your help. I will now close this issue.