Skip to content

Commit

Permalink
Tidy up as per latest change in google-workspace mod
Browse files Browse the repository at this point in the history
  • Loading branch information
rajlearner17 committed Nov 29, 2023
1 parent 80cc31d commit 2aaf332
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 42 deletions.
13 changes: 8 additions & 5 deletions transform_data_in_google_sheets/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Send Top "Show HN" Stories From Hacker News
# Transform Data in Google Spreadsheet

Send an email every day at 12 PM UTC showing the top "Show HN" stories from Hacker News ordered by score.
Find and replace text across all google spreadsheets.

## Usage

- Add your SendGrid API key to `flowpipe.pvars`
- Run the pipeline and specify `to` and `from`, e.g., `flowpipe pipeline run send_top_show_hn_email --pipeline-arg '[email protected]' --pipeline-arg '[email protected]'`
- You can specify the number of stories with `--pipeline-arg hn_story_count=10`
- Add your access token to `flowpipe.pvars`. Refer [here](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/print-access-token), how to generate access token
- Run the pipeline and specify required tex in `find_text` and `replace_text`, e.g.,

```
flowpipe pipeline run find_replace_text_in_googlesheets --arg find_text="APPLE" --arg replace_text="ORANGE"
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

pipeline "find_and_replace_in_google_sheets" {
title = "Find and Replace Word"
description = "Find and replace spefic word across all google spreadsheet."
pipeline "find_replace_text_in_googlesheets" {
title = "Find and Replace Text"
description = "Find and replace specific text across all google spreadsheet."

param "access_token" {
type = string
Expand Down Expand Up @@ -35,7 +35,7 @@ pipeline "find_and_replace_in_google_sheets" {
}

output "update_response" {
description = "Details of the find and replace."
description = "Find and replace statistics."
value = step.pipeline.find_and_replace_spreadsheet_data
}
}
3 changes: 0 additions & 3 deletions transform_data_in_google_sheets/flowpipe.fpvars.example
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
code="4/0AfJohXkXoFtU04sI2yP1NToQ5h2PHeiJsjEb3LJEgcRKSbnWg1zL4vvJCV8u9Pz2xQji3Q"
client_id="979620411234-okqtslbrgpsvspnu0040b8n8a1voiqo0.apps.googleusercontent.com"
client_secret="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"
access_token="ya29.a0AfB_byCZuOFFFF-TIRfla-_Ya0HNC5aSM-Zwqx1dU4XYKllFpijYT0k7NO3l7tbnPed2jIHiEyrZNSfui7DU9DHBh4bo8yRtTnGK2L3OJxiRtWBUc16s7lEU3mKcdyxl2ROlZg7v1SWGNwC2D7QBKE-4Kkn8xB2j9iiraCgYKAUQSARISFQHGX2Mi-kC-fZK1s4V56VXHUAgnbA0171"
11 changes: 4 additions & 7 deletions transform_data_in_google_sheets/mod.fp
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
mod "send_top_show_hn_email" {
title = "Send top 'Show HN' Email"
description = "Send an email using SendGrid containing top stories from 'Show HN'."
mod "transform_data_in_google_sheets" {
title = "Find and Replace Text"
description = "Find and replace specific text across all google spreadsheet."

require {
mod "github.com/turbot/flowpipe-mod-googleworkspace" {
version = "0.0.1-rc.1"
version = "v0.0.1-rc.6"
args = {
code = var.code
client_id = var.client_id
client_secret = var.client_secret
access_token = var.access_token
}
}
Expand Down
23 changes: 0 additions & 23 deletions transform_data_in_google_sheets/variables.fp
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
variable "code" {
description = "The authorization code generated for accessing the token."
type = string
# TODO: Add once supported
# sensitive = true
}

variable "client_id" {
description = "The client ID generated for accessing the token."
type = string
# TODO: Add once supported
# sensitive = true
}

variable "client_secret" {
description = "The client secret generated for accessing the token."
type = string
# TODO: Add once supported
# sensitive = true
}

variable "access_token" {
description = "The access token used for authentication."
type = string
# TODO: Add once supported
# sensitive = true
}

0 comments on commit 2aaf332

Please sign in to comment.