Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ If that's no problem you can head over to the [installation guide](https://nodec
- [x] OBS
- [x] Philips Hue
- [x] RCON
- [x] Reddit
- [x] sACN Receiver
- [x] sACN Sender
- [x] Serial Port (Arduino)
Expand Down
45 changes: 45 additions & 0 deletions docs/samples/reddit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Using the Reddit sample bundle

The reddit-message-read example bundle in `samples/reddit-msg-read` demonstrates the ability to read recent posts from a subreddit (in this case `r/skate702`)

### Prerequisites

- Working NodeCG & nodecg-io installation
- a Reddit Application (Should be of type script for own purpose)

_Note:_ If you don't have such an application yet you can get one [here](https://www.reddit.com/prefs/apps).

### Configure the Reddit sample bundle

1. Start nodecg with nodecg-io installed. The reddit-message-read bundle is currently part of it so it should also be loaded.

2. Go to the `nodecg-io` tab in the nodecg dashboard.

3. Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials.

4. Create a new reddit service instance using the left upper menu.

5. Enter your applications id and secret and your own username and password. Zhe entered username and password must be for the user who registered the application.

The created instance should be automatically selected, if not select it in the upper left menu. Enter your data in monaco (the text-editor on the right) in this format:

```json
{
"clientId": "Your client Id (This is displayed right below the application name)",
"clientSecret": "Your client secret",
"username": "Your username",
"password": "Your password"
}
```

After entering it, click save.

_Note:_ If you don't see monaco on the right, try reloading the page.

6. Set the created reddit service instance to the service dependency of the reddit-message-read bundle.

Select the reddit-message-read bundle and the Reddit service in the left bottom menu and then select the service instance that should be used by the reddit-message-read bundle (in this case the name of the previously created reddit instance).

7. Check the nodecg logs

You should see the recent posts in `r/skate702`
2 changes: 1 addition & 1 deletion docs/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Depends on [rcon-client](https://www.npmjs.com/package/rcon-client) @ ^4.2.0 <br

**Provides aninterface to the Reddit-API.**

There's no sample implementation for this service yet.
See the [sample implementation](samples/reddit.md)

Depends on [nodecg-io-core](https://github.com/codeoverflow-org/nodecg-io/tree/master/nodecg-io-core) @ 0.1.0 <br>
Depends on [reddit-ts](https://www.npmjs.com/package/reddit-ts) @ noeppi-noeppi/npm-reddit-ts#build <br>
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ nav:
- Midi-Output sample: samples/midi-output.md
- Midi-IO sample: samples/midi-io.md
- Rcon sample: samples/rcon.md
- Reddit Sample: samples/reddit.md
- sACN:
- sACN Receiver sample: samples/sacn-receiver.md
- sACN Sender sample: samples/sacn-sender.md
Expand Down