Skip to content

A Julia implementation of the R package longurl. For transforming short url's back into their long form.

Notifications You must be signed in to change notification settings

jrhut/Longurl.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Longurl.jl

A Julia implementation of the R package longurl. For transforming short url's back into their long form.

Installation

Install the package using Pkg.add(url="https://github.com/jrhut/Longurl.jl")

This allows you to use using Longurl

Usage

This package provides function expand_urls that will take an array of short urls and return a dataframe with the original url, expanded url and status code. If the request itself fails expanded_url and status_code will equal 'missing'.

To take advantage of the multi-threading launch julia with the argument --threads n e.g. julia ---threads 8 test.jl

  expand_urls(urls_to_expand)
  
Takes a list of short urls and exands them into their long form

...
# Arguments
- `urls_to_expand::Array`: the list of short urls
- `seconds::Int64`: the timeout in seconds
# Returns
- `Urls`: Struct containing properties expanded_url and status_code
...
 expand_url(url_to_expand)

Takes a short url and expands it into their long form

...
# Arguments
- `url_to_expand::String`: the short url
- `seconds::Int64`: the timeout in seconds
# Returns
- `Url`: Struct containing properties expanded_url and status_code
...

Examples

expand_url("https://tinyurl.com/yfr3dtha")

expand_urls(["https://tinyurl.com/yfr3dtha"])

About

A Julia implementation of the R package longurl. For transforming short url's back into their long form.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages