-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathQuiz2-Question1.R
More file actions
32 lines (23 loc) · 825 Bytes
/
Quiz2-Question1.R
File metadata and controls
32 lines (23 loc) · 825 Bytes
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
# Getting and Cleaning Data
# Coursera
# John Hopkins University
# Bastiaan Quast
# bquast@gmail.com
# copied from H. Wickham
library(httr)
# 1. Find OAuth settings for github:
# http://developer.github.com/v3/oauth/
oauth_endpoints("github")
# 2. Register an application at https://github.com/settings/applications
# Insert your values below - if secret is omitted, it will look it up in
# the GITHUB_CONSUMER_SECRET environmental variable.
#
# Use http://localhost:1410 as the callback url
myapp <- oauth_app("github", key="7eeb5753524e12ead876", secret="ef33989a51346e93a46ceecc743e6e302fdfe953")
# 3. Get OAuth credentials
github_token <- oauth2.0_token(oauth_endpoints("github"), myapp)
# 4. Use API
req <- GET("https://api.github.com/users/jtleek/repos")
stop_for_status(req)
a <- content(req)
a[4]