-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialized snoowrap and can get Reddit posts from a username
- Loading branch information
Showing
6 changed files
with
39 additions
and
1 deletion.
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,3 +1,7 @@ | ||
{ | ||
"extends": "airbnb" | ||
"extends": "airbnb", | ||
"indent": ["error", "4"], | ||
"new - cap": ["error", { | ||
"newIsCap": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,3 +105,7 @@ dist | |
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
|
||
#config | ||
config.json |
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,11 @@ | ||
const Snoowrap = require('snoowrap'); | ||
const config = require('./config'); | ||
|
||
const Reddit = new Snoowrap({ | ||
userAgent: config.userAgent, | ||
clientId: config.clientId, | ||
clientSecret: config.clientSecret, | ||
refreshToken: config.refreshToken, | ||
}); | ||
|
||
module.exports = Reddit; |
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,10 @@ | ||
const configJson = require('./config.json'); | ||
|
||
const config = { | ||
userAgent: configJson.userAgent, | ||
clientId: configJson.clientId, | ||
clientSecret: configJson.clientSecret, | ||
refreshToken: configJson.refreshToken, | ||
}; | ||
|
||
module.exports = config; |
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,3 @@ | ||
const Reddit = require('./Reddit'); | ||
|
||
Reddit.getHot().map(post => post.title).then(console.log) |
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 @@ | ||
{ | ||
"userAgent": "/* Put user Agent here */", | ||
"clientId": "/* Put your Client Id here */", | ||
"clientSecret": "/* Put your Client Secret here */", | ||
"refreshToken": "/* Put refreshToken here. For more information on getting credentials, see here: https://github.com/not-an-aardvark/reddit-oauth-helper */" | ||
} |