Automatically link stock symbols in posts

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?

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.

5 Mi Piace

Where would they link to?

Interessante…

Sarebbe meglio semplicemente Yahoo Finance?

Forse finviz.com o barchart.com?

Mi piacerebbe molto avere un plugin con questa funzionalità.

2 Mi Piace

È possibile aggiungere un prezzo in tempo reale dopo che è stato digitato un simbolo? Forse con una formattazione condizionale in verde o rosso in base alla sua variazione.

Ad esempio:

$APPL $148.70

Sarebbe possibile con un componente tema personalizzato utilizzando decorateCookedElement dall’API di Discourse. Dovresti effettuare una richiesta a un servizio di terze parti per ottenere le informazioni sulle azioni e poi integrarle.

4 Mi Piace

Grazie @awesomerobot, farò delle ricerche a riguardo.

1 Mi Piace

Dai un’occhiata a: Custom Mentionables - plugin - Discourse Meta come punto di partenza (dovresti comunque creare il dataset).

2 Mi Piace