# Discourse Linkify Google Sheets

**URL:** https://meta.discourse.org/t/discourse-linkify-google-sheets/163985
**Category:** Plugin
**Created:** [September 14, 2020, 2:43pm UTC](https://meta.discourse.org/t/discourse-linkify-google-sheets/163985 "2020-09-14T14:43:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [September 14, 2020, 2:43pm UTC](https://meta.discourse.org/t/discourse-linkify-google-sheets/163985/1 "2020-09-14T14:43:38Z")

</div>

The plugin allows fetching the [linkify](https://meta.discourse.org/t/linkify-words-in-post/82193/) Theme Component’s data from a google sheet. For now, you’ll have to install [this fork](https://github.com/paviliondev/discourse-linkify-words) of the theme component but there might be a solution in the future so you’ll be able to use the actual theme component with this plugin.

* * *

#### Setup

Steps:

1. Create a service account on google cloud [Create service accounts &nbsp;|&nbsp; Identity and Access Management (IAM) &nbsp;|&nbsp; Google Cloud Documentation](https://cloud.google.com/iam/docs/creating-managing-service-accounts)  
Google will trigger a download of a JSON file. Store its contents safely.

2. Create a google sheet and share it with the service account email address.

3. Paste these lines at the bottom of env section in your app.yml

- 
#### How to setup `GOOGLE_PRIVATE_KEY` parameter?

  - Paste the key in the json file to code editor.
  - Use find and replace and replace `\n` with `\\n`
  - Copy the result and paste it in app.yml in front of `GOOGLE_PRIVATE_KEY`  
wrapping it in single quotes `' ' `.

1. Now follow the regular steps of installing the plugin.

2. Install [this fork](https://github.com/paviliondev/discourse-linkify-words) of the Linkify Theme component.

* * *

#### Plugin Settings

`linkify_google_sheet_id`: When you open the google sheet in your browser, the long string after `https://docs.google.com/spreadsheets/d/` is the spreadsheet id.

`linkify_google_sheet_name`: You can have multiple sheets in an excel file i.e. `Sheet1`, `Sheet2` etc. That sheet name goes in here.

`linkify_google_sheet_cell_range`: The columns from where to pick up the linkify data. Its set to first two columns by default. You can change this value. Here’s a guide on the cell ranges work. [Google Sheets API Overview &nbsp;|&nbsp; Google for Developers](https://developers.google.com/sheets/api/guides/concepts)

* * *

[📄 Get the code](https://github.com/paviliondev/discourse-linkify-google-sheets)

[🙋‍♀️ Request a feature](https://thepavilion.io/w/feature-request)

[🐛 Report a bug](https://thepavilion.io/w/bug-report)

#### Lost?

- Not sure how to install a plugin? [Follow the steps here](https://meta.discourse.org/t/install-plugins-in-discourse/19157).  
  

Thanks for sponsoring the plugin @jrgong

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [September 14, 2020, 2:57pm UTC](https://meta.discourse.org/t/discourse-linkify-google-sheets/163985/2 "2020-09-14T14:57:57Z")

</div>

@sam  
With this, I’m also proposing a `plugin-api` method which allows hooking into and replacing the data source of such theme components cleanly.

e.g.

```plaintext
// while using
let data = useDataSource('linkify-data');
// plugins, theme components can do something like this

setDataSource('linkify-data', customDataObject);

```

The idea here is, some other theme component can `setDataSource` to another object.  
This would allow replacing the data source of such components without changing anything in the code.  
Thoughts?

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [September 14, 2020, 3:52pm UTC](https://meta.discourse.org/t/discourse-linkify-google-sheets/163985/3 "2020-09-14T15:52:17Z")

</div>

Love it! Thx again for the great work and implementation @fzngagan
