Package 'weburl'

Title: Parse Urls
Description: What the package does (one paragraph).
Authors: Dyfan Jones [aut, cre]
Maintainer: Dyfan Jones <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-11-10 02:58:20 UTC
Source: https://github.com/DyfanJones/weburl

Help Index


Get URL elements

Description

Get URL elements

Usage

get_scheme(url)

get_host(url)

get_port(url)

get_query(url)

get_path(url)

get_fragment(url)

get_username(url)

get_password(url)

Arguments

url

character vector of urls

Value

a vector of characters

Examples

library(weburl)

url <- "https://user:[email protected]:1234/foo/bar?baz#quux"

get_scheme(url)
get_host(url)
get_port(url)
get_path(url)
get_query(url)
get_fragment(url)
get_username(url)
get_password(url)

Set URL elements

Description

Set URL elements

Usage

set_scheme(url, scheme)

set_host(url, host)

set_port(url, port)

set_path(url, path)

set_query(url, query)

set_fragment(url, fragment)

set_username(url, username)

set_password(url, password)

Arguments

url

character vector of urls

scheme

character

host

character

port

integer

path

character vector

query

named list

fragment

character

username

character

password

character

Value

a vector of characters

Examples

library(weburl)

url <- "https://example.com"

set_scheme(url, "http")
set_host(url, "dummy.com")
set_port(url, 1234)
set_path(url, c("foo", "bar"))
set_query(url, list("baz" = "zar"))
set_fragment(url, "quux")
set_username(url, "user")
set_password(url, "pass")

Encode Url

Description

Encode Url

Usage

url_encode(url)

Arguments

url

character vector of urls

Value

a vector of characters

Examples

library(weburl)

url <- "https:www.google.com/dummy=path yo"

url_encode(url)

Parse url

Description

Parse url

Usage

url_parse(url)

Arguments

url

character vector of urls

Value

a data.frame consisting of the columns scheme, host, port, path, query and fragment.

Examples

library(weburl)

url <- "https://user:[email protected]:1234/foo/bar?baz#quux"

url_parse(url)