# Automatically link stock symbols in posts

**URL:** https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595
**Category:** Feature
**Created:** [30 mei 2017 om 05:14 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595 "2017-05-30T05:14:20Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ide](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ide/32/86305_2.png) [@ide](https://meta.discourse.org/u/ide)
#### Post date: [30 mei 2017 om 05:14 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595/1 "2017-05-30T05:14:20Z")

</div>

I’d like to customize the way posts are rendered on my hosted Discourse instance. For example, if I wanted to link stock symbols that start with a dollar sign (“cashtags”) like $AAPL, how would I do this?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [30 mei 2017 om 08:49 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595/2 "2017-05-30T08:49:19Z")

</div>

You would need to write a plugin that would scan the post content for `/\$(\w+)\b/` and replace it with a link to the corresponding stock.

_Note: if you are hosted with us, we only allow custom plugin on the enterprise data plan._

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [30 mei 2017 om 13:39 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595/3 "2017-05-30T13:39:30Z")

</div>

Where would they link to?

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [27 juni 2021 om 23:58 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595/4 "2021-06-27T23:58:32Z")

</div>

Interesting..

Best would be just yahoo finance?

Perhaps [finfiz.com](http://finfiz.com) or [barchart.com](http://barchart.com)?

I would love a plugin with this functionality.

---

<div class="post-metadata">

### Author: ![Neildb](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@Neildb](https://meta.discourse.org/u/Neildb)
#### Post date: [1 november 2021 om 15:45 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595/5 "2021-11-01T15:45:26Z")

</div>

Is there a way of adding a live price after a symbol has been typed? Possibly with conditional formatting for green or red depending on its movement.

ie

$APPL **$148.70**

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [1 november 2021 om 15:54 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595/6 "2021-11-01T15:54:13Z")

</div>

It would be possible with a custom theme component using [decorateCookedElement from the Discourse API](https://github.com/discourse/discourse/blob/69381663eb9407f93e96b739290325e4cac34945/app/assets/javascripts/discourse/app/lib/plugin-api.js#L283). You’d have to make a request to a third-party service to get the stock information, and then pull that in.

---

<div class="post-metadata">

### Author: ![Neildb](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@Neildb](https://meta.discourse.org/u/Neildb)
#### Post date: [1 november 2021 om 17:17 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595/7 "2021-11-01T17:17:34Z")

</div>

Thanks @awesomerobot will do some research into this

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [2 november 2021 om 08:06 UTC](https://meta.discourse.org/t/automatically-link-stock-symbols-in-posts/63595/8 "2021-11-02T08:06:48Z")

</div>

Take a look at: [Custom Mentionables - plugin - Discourse Meta](https://meta.discourse.org/t/custom-mentionables/192948) as a starting point (you’d have to create the dataset though).
