-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
122 lines (89 loc) · 2.1 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
output: rmarkdown::github_document
---
# varmint
Retrieve Content from and Interact with 'Gopher' Servers
## Description
The 'Gopher' protocol is a 'TCP/IP' application layer protocol
designed for distributing, searching, and retrieving documents over the
Internet. The 'Gopher' protocol was strongly oriented towards a menu-document
design and presented an alternative to the World Wide Web in its early
stages, but ultimately 'Hypertext Transfer Protocol' ('HTTP') became the
dominant protocol. The 'Gopher' ecosystem is often regarded as the effective
predecessor of the 'World Wide Web'. Tools are provided to interact with
and retrieve content from 'Gopher' servers.
## What's Inside The Tin
The following functions are implemented:
- `gopher`: Fetch a resource using the gopher protocol
- `g_content`: Retrieve the content portion of a gopher response
## TODO
- better handling of the `url` parameter to `gopher()`
- handle `URL` selectors
- handle content types
- console gopher client
- Shiny gopher client
## Installation
```{r eval=FALSE}
devtools::install_github("hrbrmstr/varmint")
```
```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE}
options(width=120)
```
## Usage
```{r message=FALSE, warning=FALSE, error=FALSE}
library(varmint)
library(tidyverse)
# current verison
packageVersion("varmint")
```
### Take a peek at one of the only remaining Gopher servers in existence:
```{r}
x <- gopher("gopher.floodgap.com")
```
```{r}
str(x)
```
```{r}
x
```
```{r}
g_content(x, TRUE) %>%
print(n = 20)
```
### See some other servers
```{r}
x1 <- gopher("gopher://gopher.floodgap.com", "/new")
```
```{r}
x1
```
```{r}
g_content(x1, TRUE) %>%
print(n = 20)
```
### Check out the Veronica menu
```{r}
x2 <- gopher("gopher://gopher.floodgap.com", "/v2")
```
```{r}
x2
```
```{r}
g_content(x2, TRUE) %>%
print(n = 20)
```
### Search for some XKCD comics
```{r}
x3 <- gopher("gopher://gopher.floodgap.com", "/v2/vs", "xkcd")
```
```{r}
x3
```
```{r}
g_content(x3, TRUE) %>%
filter(item_type_descr == "info")
```
```{r}
g_content(x3, TRUE) %>%
filter(item_type_descr == "menu")
```