-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
buttons working, post request code added(testing needed)
- Loading branch information
Showing
6 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
document.addEventListener('DOMContentLoaded', function() { | ||
document.getElementById('key_button').addEventListener('click', onClick, false) | ||
function onClick () { | ||
console.log('test') | ||
const token = prompt('Enter Access Token') | ||
console.log(token) | ||
} | ||
}, false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//code to make fork post request to github api | ||
|
||
// | ||
const { Octokit } = require("@octokit/rest"); | ||
|
||
//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 --- please DO NOT copy/paste anywhere | ||
|
||
const accToken = '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'; | ||
const testRepo = 'https://api.github.com/repos/CodesmithLLC/algorithms-elective'; | ||
//instantiate api | ||
const octokit = new Octokit({ | ||
auth: accToken, | ||
userAgent: 'auto-Fork', | ||
|
||
timeZone: 'America/New_York', | ||
|
||
//baseurl not required? | ||
|
||
//debugging | ||
log: { | ||
debug: () => {}, | ||
info: () => {}, | ||
warn: console.warn, | ||
error: console.error | ||
}, | ||
|
||
request: { | ||
agent: undefined, | ||
fetch: undefined, | ||
timeout: 0 | ||
} | ||
}); | ||
|
||
//POST request to fork public repo for authenticate user. Happens asynchronously | ||
await octokit.request('POST /repos/{owner}/{repo}/forks', { | ||
owner: 'uitie', | ||
repo: testRepo, | ||
//organization optional | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
URL | ||
------------------------------------------------------ | ||
slack github link characteristics: | ||
<a target="_blank" class="c-link" data-stringify-link="https://github.com/CodesmithLLC/unit-11-authentication" delay="150" data-sk="tooltip_parent" href="https://github.com/CodesmithLLC/unit-11-authentication" rel="noopener noreferrer">https://github.com/CodesmithLLC/unit-11-authentication</a> | ||
|
||
-class: c-link | ||
|
||
urlclipping script: | ||
const links = document.querySelectorAll("a"); | ||
const array = []; | ||
const base = 'github'; | ||
|
||
for (const link of links) { | ||
const urlClean = link.href; | ||
if (urlClean.includes(base)) array.push(urlClean); | ||
|
||
}; | ||
console.log(array); | ||
|
||
|
||
AUTHENTICATION | ||
------------------------------------------------------ | ||
https://docs.github.com/en/rest/guides/basics-of-authentication |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.