Skip to content

Commit 70988ef

Browse files
committed
update readme
1 parent 36796d8 commit 70988ef

File tree

2 files changed

+67
-63
lines changed

2 files changed

+67
-63
lines changed

README.Rmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ knitr::opts_chunk$set(
1414
[![Build Status](https://api.travis-ci.org/ropensci/gistr.png)](https://travis-ci.org/ropensci/gistr)
1515
[![Build status](https://ci.appveyor.com/api/projects/status/4jmuxbbv8qg4139t/branch/master?svg=true)](https://ci.appveyor.com/project/sckott/gistr/branch/master)
1616
[![codecov.io](https://codecov.io/github/ropensci/gistr/coverage.svg?branch=master)](https://codecov.io/github/ropensci/gistr?branch=master)
17-
[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/gistr)](https://github.com/metacran/cranlogs.app)
18-
[![cran version](http://www.r-pkg.org/badges/version/gistr)](https://cran.r-project.org/package=gistr)
17+
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/gistr)](https://github.com/metacran/cranlogs.app)
18+
[![cran version](https://www.r-pkg.org/badges/version/gistr)](https://cran.r-project.org/package=gistr)
1919

2020
`gistr` is a light interface to GitHub's gists for R.
2121

2222
## See also:
2323

2424
* [rgithub](https://github.com/cscheid/rgithub) an R client for the Github API by Carlos Scheidegger
2525
* [git2r](https://github.com/ropensci/git2r) an R client for the libgit2 C library by Stefan Widgren
26+
* [gert](https://github.com/r-lib/gert) Simple git client for R by Jeroen Ooms
2627
* [gistfo](https://github.com/MilesMcBain/gistfo) for turning your untitled RStudio tabs into gists!
2728

2829
## Quick start

README.md

Lines changed: 64 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ gistr
22
=======
33

44

5+
56
[![cran checks](https://cranchecks.info/badges/worst/gistr)](https://cranchecks.info/pkgs/gistr)
67
[![Build Status](https://api.travis-ci.org/ropensci/gistr.png)](https://travis-ci.org/ropensci/gistr)
78
[![Build status](https://ci.appveyor.com/api/projects/status/4jmuxbbv8qg4139t/branch/master?svg=true)](https://ci.appveyor.com/project/sckott/gistr/branch/master)
89
[![codecov.io](https://codecov.io/github/ropensci/gistr/coverage.svg?branch=master)](https://codecov.io/github/ropensci/gistr?branch=master)
9-
[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/gistr)](https://github.com/metacran/cranlogs.app)
10-
[![cran version](http://www.r-pkg.org/badges/version/gistr)](https://cran.r-project.org/package=gistr)
10+
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/gistr)](https://github.com/metacran/cranlogs.app)
11+
[![cran version](https://www.r-pkg.org/badges/version/gistr)](https://cran.r-project.org/package=gistr)
1112

1213
`gistr` is a light interface to GitHub's gists for R.
1314

1415
## See also:
1516

1617
* [rgithub](https://github.com/cscheid/rgithub) an R client for the Github API by Carlos Scheidegger
1718
* [git2r](https://github.com/ropensci/git2r) an R client for the libgit2 C library by Stefan Widgren
19+
* [gert](https://github.com/r-lib/gert) Simple git client for R by Jeroen Ooms
1820
* [gistfo](https://github.com/MilesMcBain/gistfo) for turning your untitled RStudio tabs into gists!
1921

2022
## Quick start
@@ -44,7 +46,7 @@ library("gistr")
4446

4547
There are two ways to authorise gistr to work with your GitHub account:
4648

47-
* Generate a personal access token (PAT) at [https://help.github.com/articles/creating-an-access-token-for-command-line-use](https://help.github.com/articles/creating-an-access-token-for-command-line-use) and record it in the `GITHUB_PAT` environment variable.
49+
* Generate a personal access token (PAT) **with the gist scope selected** at [https://help.github.com/articles/creating-an-access-token-for-command-line-use](https://help.github.com/articles/creating-an-access-token-for-command-line-use) and record it in the `GITHUB_PAT` environment variable.
4850
- To test out this approach, execute this in R: `Sys.setenv(GITHUB_PAT = "blahblahblah")`, where "blahblahblah" is the PAT you got from GitHub. Then take `gistr` out for a test drive.
4951
- If that works, you will probably want to define the GITHUB_PAT environment variable in a file such as `~/.bash_profile` or `~/.Renviron`.
5052
* Interactively login into your GitHub account and authorise with OAuth.
@@ -94,8 +96,8 @@ update(add_files(gists(what = "minepublic")[[1]], file))
9496
```r
9597
rate_limit()
9698
#> Rate limit: 5000
97-
#> Remaining: 4975
98-
#> Resets in: 56 minutes
99+
#> Remaining: 4897
100+
#> Resets in: 55 minutes
99101
```
100102

101103
### List gists
@@ -106,21 +108,21 @@ Limiting to a few results here to keep it brief
106108
```r
107109
gists(per_page = 2)
108110
#> [[1]]
109-
#> <gist>6ac700bec42f7563bf809d8d92ae4906
110-
#> URL: https://gist.github.com/6ac700bec42f7563bf809d8d92ae4906
111-
#> Description: Password Dictionary for Brute force attack
111+
#> <gist>d78aa1e84304254cda4629f7b5673d40
112+
#> URL: https://gist.github.com/d78aa1e84304254cda4629f7b5673d40
113+
#> Description:
112114
#> Public: TRUE
113-
#> Created/Edited: 2018-04-16T21:25:21Z / 2018-04-16T21:25:22Z
114-
#> Files: dictionary.txt
115+
#> Created/Edited: 2020-01-08T17:03:11Z / 2020-01-08T17:03:12Z
116+
#> Files: handsontable.full.min.js
115117
#> Truncated?: FALSE
116118
#>
117119
#> [[2]]
118-
#> <gist>89df33d7a21ed92d2fad5c4cec96f8ae
119-
#> URL: https://gist.github.com/89df33d7a21ed92d2fad5c4cec96f8ae
120-
#> Description: Export documents to a zip file
120+
#> <gist>f53546b3fd60a306da6c5068726c5f53
121+
#> URL: https://gist.github.com/f53546b3fd60a306da6c5068726c5f53
122+
#> Description: 17_webhook.js
121123
#> Public: TRUE
122-
#> Created/Edited: 2018-04-16T21:25:03Z / 2018-04-16T21:25:04Z
123-
#> Files: export_zip.xqy
124+
#> Created/Edited: 2020-01-08T17:02:55Z / 2020-01-08T17:02:55Z
125+
#> Files: 17_webhook.js
124126
#> Truncated?: FALSE
125127
```
126128

@@ -130,21 +132,21 @@ Since a certain date/time
130132
```r
131133
gists(since='2014-05-26T00:00:00Z', per_page = 2)
132134
#> [[1]]
133-
#> <gist>6ac700bec42f7563bf809d8d92ae4906
134-
#> URL: https://gist.github.com/6ac700bec42f7563bf809d8d92ae4906
135-
#> Description: Password Dictionary for Brute force attack
135+
#> <gist>d78aa1e84304254cda4629f7b5673d40
136+
#> URL: https://gist.github.com/d78aa1e84304254cda4629f7b5673d40
137+
#> Description:
136138
#> Public: TRUE
137-
#> Created/Edited: 2018-04-16T21:25:21Z / 2018-04-16T21:25:22Z
138-
#> Files: dictionary.txt
139+
#> Created/Edited: 2020-01-08T17:03:11Z / 2020-01-08T17:03:12Z
140+
#> Files: handsontable.full.min.js
139141
#> Truncated?: FALSE
140142
#>
141143
#> [[2]]
142-
#> <gist>89df33d7a21ed92d2fad5c4cec96f8ae
143-
#> URL: https://gist.github.com/89df33d7a21ed92d2fad5c4cec96f8ae
144-
#> Description: Export documents to a zip file
144+
#> <gist>f53546b3fd60a306da6c5068726c5f53
145+
#> URL: https://gist.github.com/f53546b3fd60a306da6c5068726c5f53
146+
#> Description: 17_webhook.js
145147
#> Public: TRUE
146-
#> Created/Edited: 2018-04-16T21:25:03Z / 2018-04-16T21:25:04Z
147-
#> Files: export_zip.xqy
148+
#> Created/Edited: 2020-01-08T17:02:55Z / 2020-01-08T17:02:55Z
149+
#> Files: 17_webhook.js
148150
#> Truncated?: FALSE
149151
```
150152

@@ -154,21 +156,21 @@ Request different types of gists, one of public, minepublic, mineall, or starred
154156
```r
155157
gists('minepublic', per_page = 2)
156158
#> [[1]]
157-
#> <gist>d6c06c121e70016e1caf159c7d7b6aa6
158-
#> URL: https://gist.github.com/d6c06c121e70016e1caf159c7d7b6aa6
159-
#> Description:
159+
#> <gist>7b8f60796af0588dfc73576d865e0661
160+
#> URL: https://gist.github.com/7b8f60796af0588dfc73576d865e0661
161+
#> Description: gist gist gist
160162
#> Public: TRUE
161-
#> Created/Edited: 2018-04-16T21:24:47Z / 2018-04-16T21:24:55Z
162-
#> Files: code.R
163-
#> Truncated?: FALSE
163+
#> Created/Edited: 2020-01-08T17:00:22Z / 2020-01-08T17:00:23Z
164+
#> Files: stuff.md, zoo.json
165+
#> Truncated?: FALSE, FALSE
164166
#>
165167
#> [[2]]
166-
#> <gist>f271bcf55ad2e17c34f4e99e2458d232
167-
#> URL: https://gist.github.com/f271bcf55ad2e17c34f4e99e2458d232
168-
#> Description: a new cool gist
168+
#> <gist>c7615e91cc895073cd4797f3611d2e76
169+
#> URL: https://gist.github.com/c7615e91cc895073cd4797f3611d2e76
170+
#> Description:
169171
#> Public: TRUE
170-
#> Created/Edited: 2018-04-16T21:24:46Z / 2018-04-16T21:24:46Z
171-
#> Files: stuff.md
172+
#> Created/Edited: 2019-12-09T17:08:30Z / 2019-12-09T17:08:30Z
173+
#> Files: pleiades4d094996f27f.geojson
172174
#> Truncated?: FALSE
173175
```
174176

@@ -195,11 +197,11 @@ You can pass in files
195197
```r
196198
file <- system.file("examples", "stuff.md", package = "gistr")
197199
gist_create(file, description='a new cool gist', browse = FALSE)
198-
#> <gist>7563b7654b15a8c4cc9f69880ae78d18
199-
#> URL: https://gist.github.com/7563b7654b15a8c4cc9f69880ae78d18
200+
#> <gist>073c7097bb0cad5722ebc13f1c37e4f8
201+
#> URL: https://gist.github.com/073c7097bb0cad5722ebc13f1c37e4f8
200202
#> Description: a new cool gist
201203
#> Public: TRUE
202-
#> Created/Edited: 2018-04-16T21:25:58Z / 2018-04-16T21:25:58Z
204+
#> Created/Edited: 2020-01-08T17:03:26Z / 2020-01-08T17:03:26Z
203205
#> Files: stuff.md
204206
#> Truncated?: FALSE
205207
```
@@ -226,11 +228,11 @@ numbers
226228
227229
[1] 0.3229318 0.5933054 0.7778408 0.3898947 0.1309717 0.7501378 0.3206379 0.3379005
228230
'}, browse=FALSE)
229-
#> <gist>b7f90fcb99dae005db9d837f1a21ee03
230-
#> URL: https://gist.github.com/b7f90fcb99dae005db9d837f1a21ee03
231+
#> <gist>b3da1493d09ba15a5d9695b428219601
232+
#> URL: https://gist.github.com/b3da1493d09ba15a5d9695b428219601
231233
#> Description:
232234
#> Public: TRUE
233-
#> Created/Edited: 2018-04-16T21:26:00Z / 2018-04-16T21:26:00Z
235+
#> Created/Edited: 2020-01-08T17:03:28Z / 2020-01-08T17:03:28Z
234236
#> Files: code.R
235237
#> Truncated?: FALSE
236238
```
@@ -275,11 +277,11 @@ knit a local file
275277
```r
276278
file <- system.file("examples", "stuff.Rmd", package = "gistr")
277279
run(file, knitopts = list(quiet=TRUE)) %>% gist_create(browse = FALSE)
278-
#> <gist>5f05cf24cf459e0818ae2e128c14f301
279-
#> URL: https://gist.github.com/5f05cf24cf459e0818ae2e128c14f301
280+
#> <gist>cc76dd026ff004b2bc1ec5591d7528e8
281+
#> URL: https://gist.github.com/cc76dd026ff004b2bc1ec5591d7528e8
280282
#> Description:
281283
#> Public: TRUE
282-
#> Created/Edited: 2018-04-16T21:26:01Z / 2018-04-16T21:26:01Z
284+
#> Created/Edited: 2020-01-08T17:03:30Z / 2020-01-08T17:03:30Z
283285
#> Files: stuff.md
284286
#> Truncated?: FALSE
285287
```
@@ -344,9 +346,9 @@ gist_create(file, knit=TRUE, imgur_inject = TRUE)
344346
gists()[[1]] %>% commits()
345347
#> [[1]]
346348
#> <commit>
347-
#> Version: bf6f7fcb219bed1ac3de465f707d17d344da4c22
349+
#> Version: 06e379abc23086722593c7026f8a169991bb9791
348350
#> User: sckott
349-
#> Commited: 2018-04-16T21:25:59Z
351+
#> Commited: 2020-01-08T17:03:27Z
350352
#> Commits [total, additions, deletions]: [5,5,0]
351353
```
352354

@@ -368,6 +370,7 @@ gist('cbb0507082bb18ff7e4b') %>% star()
368370

369371
Unstar
370372

373+
371374
```r
372375
gist('cbb0507082bb18ff7e4b') %>% unstar()
373376
#> <gist>cbb0507082bb18ff7e4b
@@ -389,11 +392,11 @@ file <- system.file("examples", "alm.md", package = "gistr")
389392
gists(what = "minepublic")[[1]] %>%
390393
add_files(file) %>%
391394
update()
392-
#> <gist>b7f90fcb99dae005db9d837f1a21ee03
393-
#> URL: https://gist.github.com/b7f90fcb99dae005db9d837f1a21ee03
395+
#> <gist>b3da1493d09ba15a5d9695b428219601
396+
#> URL: https://gist.github.com/b3da1493d09ba15a5d9695b428219601
394397
#> Description:
395398
#> Public: TRUE
396-
#> Created/Edited: 2018-04-16T21:26:00Z / 2018-04-16T21:26:25Z
399+
#> Created/Edited: 2020-01-08T17:03:28Z / 2020-01-08T17:03:34Z
397400
#> Files: alm.md, code.R
398401
#> Truncated?: FALSE, FALSE
399402
```
@@ -406,11 +409,11 @@ file <- system.file("examples", "alm.md", package = "gistr")
406409
gists(what = "minepublic")[[1]] %>%
407410
delete_files(file) %>%
408411
update()
409-
#> <gist>b7f90fcb99dae005db9d837f1a21ee03
410-
#> URL: https://gist.github.com/b7f90fcb99dae005db9d837f1a21ee03
412+
#> <gist>b3da1493d09ba15a5d9695b428219601
413+
#> URL: https://gist.github.com/b3da1493d09ba15a5d9695b428219601
411414
#> Description:
412415
#> Public: TRUE
413-
#> Created/Edited: 2018-04-16T21:26:00Z / 2018-04-16T21:26:26Z
416+
#> Created/Edited: 2020-01-08T17:03:28Z / 2020-01-08T17:03:36Z
414417
#> Files: code.R
415418
#> Truncated?: FALSE
416419
```
@@ -429,7 +432,7 @@ gists()[[1]] %>% browse()
429432

430433
```r
431434
gists()[[1]] %>% embed()
432-
#> [1] "<script src=\"https://gist.github.com/sckott/b7f90fcb99dae005db9d837f1a21ee03.js\"></script>"
435+
#> [1] "<script src=\"https://gist.github.com/sckott/b3da1493d09ba15a5d9695b428219601.js\"></script>"
433436
```
434437

435438
### List forks
@@ -444,7 +447,7 @@ gist(id='1642874') %>% forks(per_page=2)
444447
#> URL: https://gist.github.com/1642989
445448
#> Description: Spline Transition
446449
#> Public: TRUE
447-
#> Created/Edited: 2012-01-19T21:45:20Z / 2018-02-07T07:49:17Z
450+
#> Created/Edited: 2012-01-19T21:45:20Z / 2019-10-23T20:09:07Z
448451
#> Files:
449452
#> Truncated?:
450453
#>
@@ -453,7 +456,7 @@ gist(id='1642874') %>% forks(per_page=2)
453456
#> URL: https://gist.github.com/1643051
454457
#> Description: Line Transition (Broken)
455458
#> Public: TRUE
456-
#> Created/Edited: 2012-01-19T21:51:30Z / 2016-12-01T07:19:06Z
459+
#> Created/Edited: 2012-01-19T21:51:30Z / 2019-10-23T20:08:44Z
457460
#> Files:
458461
#> Truncated?:
459462
```
@@ -466,12 +469,12 @@ Returns a `gist` object
466469
```r
467470
g <- gists()
468471
(forked <- g[[ sample(seq_along(g), 1) ]] %>% fork())
469-
#> <gist>ca541fdae95e8a2e009bea872595bd2b
470-
#> URL: https://gist.github.com/ca541fdae95e8a2e009bea872595bd2b
471-
#> Description:
472+
#> <gist>2052cabf87af7facf353df7fe0d83ab8
473+
#> URL: https://gist.github.com/2052cabf87af7facf353df7fe0d83ab8
474+
#> Description: Fetch company details with theirs posts & comments
472475
#> Public: TRUE
473-
#> Created/Edited: 2018-04-16T21:26:33Z / 2018-04-16T21:26:33Z
474-
#> Files: .py
476+
#> Created/Edited: 2020-01-08T17:03:42Z / 2020-01-08T17:03:42Z
477+
#> Files: company.js
475478
#> Truncated?: FALSE
476479
```
477480

0 commit comments

Comments
 (0)