Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Little refresh, It's r/WSB time.
Browse files Browse the repository at this point in the history
Felt the need to update and fix some things as I'm playing the WSB game again.

Wish me luck I'm DD'ing on BB.
  • Loading branch information
PhoenixSheppy committed Jan 25, 2021
1 parent 24dd05e commit 8c7c676
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4350,3 +4350,4 @@ node_modules/yauzl/index.js
node_modules/yauzl/LICENSE
node_modules/yauzl/package.json
node_modules/yauzl/README.md
node_modules/discord-rich-presence/node_modules/discord-rpc/.github/workflows/docs.yml
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Stockticker-DiscordRPC
Displays the current stock price of NET (Cloudflare) as your Discord Rich Presence, because why not!
Displays the current stock price of your favorite stock (Mine is Blackberry, WSB, of course.) as your Discord Rich Presence, because why not!

I made this as a joke, as I purchased a few shares of NET (Cloudflare) and wanted to show my "loyalty" by making my rich presence the current stock price.
I made this as a joke, as I purchased a few shares of NET (Cloudflare), and now Blackberry, and wanted to show my "loyalty" by making my rich presence the current stock price.

To run, simply copy the repo into a folder, (I'm assuming you already have NodeJS and Git Installed if we're working with JS.) and run ```npm i```, then run ```node index.js```.
To run, simply copy the repo into a folder, (I'm assuming you already have NodeJS and Git Installed.) and run ```npm i```, then run ```node index.js```.
To quit / stop, press: ```ctrl + c```

### Demonstration of RPC (Rich Presence In Action)
Expand Down
15 changes: 8 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@

// --- DEVELOPED / CREATED BY PHOENIXTHEDOGGO / PHOENIX SHEPHERD, WITH THE ASSISTANCE OF JACK FOX (https://github.com/Nexure)
// --- DEVELOPED / CREATED BY PHOENIXSHEPPY / PHOENIX SHEPHERD, WITH THE ASSISTANCE OF JACK FOX (https://github.com/Nexure)

var yahooStockPrices = require('yahoo-stock-prices');
var NETprice = ""; // --- So like, "NETprice" is a variable I used to determine what the current stock price is at any give time so that I can fill the STATE field in RPC.
const client = require('discord-rich-presence')('715252355209232435');
var stockPrice = ""; // --- So like, "stockPrice" is a variable I used to determine what the current stock price is at any give time so that I can fill the STATE field in RPC.
const client = require('discord-rich-presence')('803082200550735883');
var stockTicker = "bb"; // --- This is the stock symbol of the stock you want to track, for instance I want Blackberry, so I put "bb".

function updatePrices(){
yahooStockPrices.getCurrentPrice('NET', function(err, price){ // --- 'NET' is the stock name. Replace with whatever you want to track :3
yahooStockPrices.getCurrentPrice(stockTicker, function(err, price){

NETprice=(price).toFixed(2); // --- So feel free to rename / replace it.
stockPrice=(price).toFixed(2);

// --- DISCORD RPC

client.updatePresence({
state: `$${NETprice}/share`, // -- And here.
state: `$${stockPrice}/share`,
details: 'Currently Worth:',
largeImageKey: 'cf', // --- cf is an asset on Discord's Developer Portal. Replace with that you name your asset.
largeImageKey: 'bb', // --- bb is an asset on Discord's Developer Portal. Replace with that you name your asset.
instance: true,
});

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c7c676

Please sign in to comment.