Description Usage Arguments Value Examples
View source: R/podlove_get_and_clean.R
podlove_get_and_clean
opens up a connection to a Podlove-enable
Wordpress MySQL database, gets all necessary tables, connects and cleans
the data and returns it as a data frame. The function uses
rstudioapi::askForSecret()
, which allows securely storing access
info in the local keyring.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | podlove_get_and_clean(
db_name = rstudioapi::askForSecret(name = "dbname", message =
"Enter the name of the database", title = "Database Name"),
db_host = rstudioapi::askForSecret(name = "host", message =
"Enter the hostname of the database", title = "Hostname"),
db_user = rstudioapi::askForSecret(name = "user", message =
"Enter the user name of the database", title = "User Name"),
db_password = rstudioapi::askForSecret(name = "password", message =
"Enter the Password", title = "Password"),
launch_date = NULL,
ddupe = FALSE,
tbl_prefix = "wp_",
tbl_downloads = "podlove_downloadintentclean",
tbl_mediafile = "podlove_mediafile",
tbl_useragent = "podlove_useragent",
tbl_episode = "podlove_episode",
tbl_posts = "posts"
)
|
db_name |
name of the database |
db_host |
hostname of the database |
db_user |
username of the database |
db_password |
password of the database |
launch_date |
date of the first official podcast episode release |
ddupe |
boolean switcher for legacy deduplication. Don't use this until you know what you're doing. |
tbl_prefix |
prefix of the MySLQ table names, defaults to 'wp_' |
tbl_downloads |
name of the MySQL table for clean downloads (without the prefix) |
tbl_mediafile |
name of the MySQL table for mediafiles (without the prefix) |
tbl_useragent |
name of the MySQL table for useragents (without the prefix) |
tbl_episode |
name of the MySQL table for episodes (without the prefix) |
tbl_posts |
name of the MySQL table for posts (without the prefix) |
a dataframe containing all episode download attempts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
# will ask for db name, host, username, password
dlic_raw <- podlove_get_and_clean(launchdate = "2019-05-01")
## End(Not run)
## Not run:
# don't use clear access data in functions, never save passwords to .R files!
download_data <- podlove_get_and_clean(dbname = "my_sql_database",
host = "my.database.host",
user = "username,"
password = "my.secret.password",
launchdate = "2019-05-01")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.