Title: | Wrapper for the Filebin File Sharing API |
---|---|
Description: | A wrapper for the Filebin API. Filebin implements convenient file sharing on the web. |
Authors: | Andrew B. Collier [aut, cre, cph] |
Maintainer: | Andrew B. Collier <[email protected]> |
License: | GPL-3 |
Version: | 0.0.6 |
Built: | 2024-10-25 03:16:22 UTC |
Source: | https://github.com/datawookie/filebin |
Set or query API base URL
base_url(url = NULL)
base_url(url = NULL)
url |
Base URL. |
URL string.
base_url("https://testnet.binance.vision/")
base_url("https://testnet.binance.vision/")
Get contents of bin as archive
bin_archive(bin, format = "zip", file = NA)
bin_archive(bin, format = "zip", file = NA)
bin |
Bin name. If |
format |
Archive format. Either |
file |
File name to use to save results. |
File name as character vector.
## Not run: bin_archive("placeholder", file = tempfile(fileext = ".zip")) ## End(Not run)
## Not run: bin_archive("placeholder", file = tempfile(fileext = ".zip")) ## End(Not run)
Delete a bin from Filebin
bin_delete(bin)
bin_delete(bin)
bin |
Bin name. If |
A Boolean indicating whether bin was successfully deleted.
## Not run: bin_delete("placeholder") bin_delete("https://filebin.net/placeholder/") ## End(Not run)
## Not run: bin_delete("placeholder") bin_delete("https://filebin.net/placeholder/") ## End(Not run)
Retrieve a bin from Filebin
bin_get(bin)
bin_get(bin)
bin |
Bin name. If |
A tibble.
## Not run: posted <- file_post(LOREM_IPSUM) bin_get(posted$bin) ## End(Not run)
## Not run: posted <- file_post(LOREM_IPSUM) bin_get(posted$bin) ## End(Not run)
Lock a bin on Filebin
bin_lock(bin)
bin_lock(bin)
bin |
Bin name. If |
A Boolean.
## Not run: posted <- file_post(LOREM_IPSUM) bin_get(posted$bin) ## End(Not run)
## Not run: posted <- file_post(LOREM_IPSUM) bin_get(posted$bin) ## End(Not run)
Create random bin name for Filebin
bin_name_random(length = 16, pattern = "[a-z0-9]")
bin_name_random(length = 16, pattern = "[a-z0-9]")
length |
Number of characters in bin name. Must be 8 or more. |
pattern |
Character set. |
A character vector.
bin_name_random(8)
bin_name_random(8)
Get QR code for bin on Filebin
bin_qr_code(bin, file = NA)
bin_qr_code(bin, file = NA)
bin |
Bin name. If |
file |
File name to use to save results. |
File name of the archive.
## Not run: posted <- file_post(LOREM_IPSUM, bin = "latin-text") bin_qr_code("latin-text", file = tempfile(fileext = ".png")) ## End(Not run)
## Not run: posted <- file_post(LOREM_IPSUM, bin = "latin-text") bin_qr_code("latin-text", file = tempfile(fileext = ".png")) ## End(Not run)
Delete a file from Filebin
file_delete(filename, bin)
file_delete(filename, bin)
filename |
File name or URL. |
bin |
Bin name. If |
A Boolean indicating whether file was successfully deleted.
## Not run: posted <- file_post(LOREM_IPSUM, bin = "latin-text") file_delete("lorem-ipsum.txt", "latin-text") file_delete("https://filebin.net/latin-text/lorem-ipsum.txt") ## End(Not run)
## Not run: posted <- file_post(LOREM_IPSUM, bin = "latin-text") file_delete("lorem-ipsum.txt", "latin-text") file_delete("https://filebin.net/latin-text/lorem-ipsum.txt") ## End(Not run)
Retrieve a file from Filebin
file_get(filename, bin, file = NA, overwrite = FALSE)
file_get(filename, bin, file = NA, overwrite = FALSE)
filename |
File name or URL. |
bin |
Bin name. If |
file |
File name to use to save results. If |
overwrite |
Whether to overwrite existing file. |
Contents of file.
## Not run: posted <- file_post(LOREM_IPSUM, bin = "latin-text") # Discard path and just retain filename. filename <- basename(LOREM_IPSUM) file_get(filename, "latin-text") # Delete downloaded file. file.remove(filename) ## End(Not run)
## Not run: posted <- file_post(LOREM_IPSUM, bin = "latin-text") # Discard path and just retain filename. filename <- basename(LOREM_IPSUM) file_get(filename, "latin-text") # Delete downloaded file. file.remove(filename) ## End(Not run)
Upload a file to Filebin
file_post(path, bin = NA)
file_post(path, bin = NA)
path |
Path to a file. If a vector then upload multiple files. |
bin |
Bin name. If |
A tibble.
## Not run: # Upload a single file. file_post(LOREM_IPSUM) # Upload multiple files. file_post(c(LOREM_IPSUM, MORE_LOREM_IPSUM)) # Upload to a specific bin. bin <- bin_name_random(length = 24) file_post(LOREM_IPSUM, bin) ## End(Not run)
## Not run: # Upload a single file. file_post(LOREM_IPSUM) # Upload multiple files. file_post(c(LOREM_IPSUM, MORE_LOREM_IPSUM)) # Upload to a specific bin. bin <- bin_name_random(length = 24) file_post(LOREM_IPSUM, bin) ## End(Not run)
Paths of sample data files
LOREM_IPSUM MORE_LOREM_IPSUM
LOREM_IPSUM MORE_LOREM_IPSUM
An object of class NULL
of length 0.
An object of class NULL
of length 0.