-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d04eaf
commit fda07d0
Showing
24 changed files
with
69 additions
and
13 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
target/ | ||
Cargo.lock | ||
__pycache__ | ||
*.pyc | ||
*.pyc | ||
node_modules/ |
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 |
---|---|---|
@@ -1,10 +1,4 @@ | ||
[workspace] | ||
members = [ | ||
"rookie-rs", | ||
"bindings/python", | ||
"bindings/node", | ||
"cli", | ||
"rookie-rs/examples/*", | ||
] | ||
members = ["rookie-rs", "bindings/python", "bindings/node", "cli"] | ||
default-members = ["rookie-rs", "bindings/python"] | ||
resolver = "2" |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,14 @@ | ||
# Rookie JavaScript Docs | ||
|
||
## Install | ||
|
||
```typescript | ||
npm install @rookie/api | ||
``` | ||
|
||
## Basic Usage | ||
|
||
```js | ||
import { brave } from "@rookie/api"; | ||
const cookies = brave(); | ||
``` |
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,25 @@ | ||
import rookie from "@rookie-rs/api"; | ||
|
||
function createHeaders() { | ||
// Get all Github cookies from Brave browser | ||
const cookies = rookie.brave(["github.com"]); | ||
// Create cookie header | ||
const cookie = cookies | ||
.map((c) => decodeURIComponent(`${c.name}=${c.value}`)) | ||
.join(";"); | ||
const userAgent = | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"; | ||
return { | ||
"User-Agent": userAgent, | ||
Cookie: cookie, | ||
}; | ||
} | ||
|
||
const headers = createHeaders(); | ||
const res = await fetch("https://github.com/settings/profile", { headers }); | ||
const html = await res.text(); | ||
// Parse username from HTML | ||
const username = | ||
html.match(/<a href="\/(.+)" class="btn.+>/)?.[1] ?? | ||
`Not Logged In. Response URL: ${res.url}`; | ||
console.log(`Github username: ${username}`); |
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,6 @@ | ||
{ | ||
"type": "module", | ||
"dependencies": { | ||
"@rookie-rs/api": "^0.0.1-beta.4" | ||
} | ||
} |
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,5 @@ | ||
import rookie from "@rookie-rs/api"; | ||
|
||
for (const cookie of rookie.brave()) { | ||
console.log(cookie); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
rookiepy |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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