Type: | Package |
Title: | Wrapper for the Filebin File Sharing API |
Version: | 0.0.6 |
Description: | A wrapper for the Filebin API. Filebin implements convenient file sharing on the web. |
License: | GPL-3 |
Language: | en-GB |
Encoding: | UTF-8 |
Imports: | dplyr, httr, janitor, logger, purrr, stringi, tibble, tidyr |
Suggests: | reticulate, spelling, stevedore, testthat (≥ 3.0.0), withr |
Config/testthat/edition: | 3 |
RoxygenNote: | 7.2.3 |
Depends: | R (≥ 2.10) |
NeedsCompilation: | no |
Packaged: | 2023-09-01 16:54:04 UTC; wookie |
Author: | Andrew B. Collier [aut, cre, cph] |
Maintainer: | Andrew B. Collier <andrew.b.collier@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2023-09-02 04:10:02 UTC |
Set or query API base URL
Description
Set or query API base URL
Usage
base_url(url = NULL)
Arguments
url |
Base URL. |
Value
URL string.
Examples
base_url("https://testnet.binance.vision/")
Get contents of bin as archive
Description
Get contents of bin as archive
Usage
bin_archive(bin, format = "zip", file = NA)
Arguments
bin |
Bin name. If |
format |
Archive format. Either |
file |
File name to use to save results. |
Value
File name as character vector.
Examples
## Not run:
bin_archive("placeholder", file = tempfile(fileext = ".zip"))
## End(Not run)
Delete a bin from Filebin
Description
Delete a bin from Filebin
Usage
bin_delete(bin)
Arguments
bin |
Bin name. If |
Value
A Boolean indicating whether bin was successfully deleted.
Examples
## Not run:
bin_delete("placeholder")
bin_delete("https://filebin.net/placeholder/")
## End(Not run)
Retrieve a bin from Filebin
Description
Retrieve a bin from Filebin
Usage
bin_get(bin)
Arguments
bin |
Bin name. If |
Value
A tibble.
Examples
## Not run:
posted <- file_post(LOREM_IPSUM)
bin_get(posted$bin)
## End(Not run)
Lock a bin on Filebin
Description
Lock a bin on Filebin
Usage
bin_lock(bin)
Arguments
bin |
Bin name. If |
Value
A Boolean.
Examples
## Not run:
posted <- file_post(LOREM_IPSUM)
bin_get(posted$bin)
## End(Not run)
Create random bin name for Filebin
Description
Create random bin name for Filebin
Usage
bin_name_random(length = 16, pattern = "[a-z0-9]")
Arguments
length |
Number of characters in bin name. Must be 8 or more. |
pattern |
Character set. |
Value
A character vector.
Examples
bin_name_random(8)
Get QR code for bin on Filebin
Description
Get QR code for bin on Filebin
Usage
bin_qr_code(bin, file = NA)
Arguments
bin |
Bin name. If |
file |
File name to use to save results. |
Value
File name of the archive.
Examples
## 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
Description
Delete a file from Filebin
Usage
file_delete(filename, bin)
Arguments
filename |
File name or URL. |
bin |
Bin name. If |
Value
A Boolean indicating whether file was successfully deleted.
Examples
## 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
Description
Retrieve a file from Filebin
Usage
file_get(filename, bin, file = NA, overwrite = FALSE)
Arguments
filename |
File name or URL. |
bin |
Bin name. If |
file |
File name to use to save results. If |
overwrite |
Whether to overwrite existing file. |
Value
Contents of file.
Examples
## 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
Description
Upload a file to Filebin
Usage
file_post(path, bin = NA)
Arguments
path |
Path to a file. If a vector then upload multiple files. |
bin |
Bin name. If |
Value
A tibble.
Examples
## 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
Description
Paths of sample data files
Usage
LOREM_IPSUM
MORE_LOREM_IPSUM
Format
An object of class NULL
of length 0.
An object of class NULL
of length 0.