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

Commit 8525a49

Browse files
cschalk-googsqrrrl
andauthored
Cschalk 1st (#178)
* initial checkin of news sample * slight update to readme * A simple update to test new SSH key * another test submit * another tweak to readme. Just testing github * Initial Checkin of News Sentiment * Updates to ReadMe per initial review * final checkin per Readme review * Updated ReadMe * fixed the updated date in ReadMe Co-authored-by: Steven Bazyl <sbazyl@google.com>
1 parent f6ae8a0 commit 8525a49

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

news-sentiment/README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Analyze the sentiment of news headlines retrieved for a user-specif
44
labels: Apps Script, Sheets, Cloud Natural Language
55
material_icon: Feed
66
create_time: 2021-03-22
7-
update_time: 2021-03-29
7+
update_time: 2021-03-30
88
---
99

1010
This solution showcases natural language sentiment analysis on current news headlines. It consists of a Google Sheet that uses Apps Script to fetch the current news headlines from the free news API `newsapi.org` using a user-provided `topic`.
@@ -21,30 +21,27 @@ As the sentiments are returned from the API, the script updates the sheet with b
2121
## Try it
2222

2323
### Before you begin: Obtain your API keys
24-
To run this solution you need to get 2 API keys, one from the [Google Cloud Natural Language API](https://cloud.google.com/natural-language), and the second from the free News API @ [http://newsapi.org/](http://newsapi.org/).
24+
To run this solution you need to get 2 API keys, one from the [Google Cloud Natural Language API](https://cloud.google.com/natural-language), and the second from the free [News API](http://newsapi.org/).
2525

2626
#### Get the Google Cloud Natural Language API key
2727

2828
To get an API key for the Google Cloud Natural Language API, you must configure a Google Cloud Platform (GCP) project.
2929

30-
1. Create a new or use an existing GCP project:
31-
1. Navigate to the main {{console_name_short}} page.
32-
33-
[Cloud Console]({{console_url}}){: class="button button-primary" target="console" track-name="consoleLink" track-type="tutorial" track-metadata-position="body"}
34-
35-
* If you need to create a new project:
36-
* Select your associated billing account.
37-
* Accept the defaults for organization and location.
38-
* Click **Create**, and then select the new project in the console.
39-
40-
1. At the top of the console, click <span class=”material-icons”>menu</span> <span aria-label="and then">></span> **APIs & Services**.
41-
Click **+ Enable APIs and Services**.
30+
1. Create a new or use an existing GCP project.
31+
1. Navigate to the [Google Cloud Platform console](https://console.cloud.google.com)
32+
* If you create a new project:
33+
* Select your associated billing account.
34+
* Accept the defaults for organization and location.
35+
* Click **Create**, and then select the new project in the console.
36+
1. At the top of the console, click <span class=”material-icons”>menu</span> <span aria-label="and then">></span> **APIs & Services**.
37+
1. Click **+ Enable APIs and Services**.
4238
1. Search for `Cloud Natural Language API`, and enable it.
4339
1. On the left, click **Credentials** <span aria-label="and then">></span> **+ Create credentials**.
4440
1. In the drop-down menu, select **API key**.
45-
1. Save this key to add to your Apps Script `Code.gs` file.
41+
* Save this key to add to your Apps Script `Code.gs` file.
42+
43+
#### Register for the News API key
4644

47-
#### Register for the News API key.
4845
To get an API key for the News API, you need to create a free News API account.
4946
1. To create an account, go to the [News API](https://newsapi.org/) site.
5047
1. Click **Get API Key** and follow the steps.
@@ -53,7 +50,7 @@ To get an API key for the News API, you need to create a free News API account.
5350
### Create your copy of the solution
5451
Copy and customize the solution with your API keys.
5552

56-
1. Click to make a copy of the [News Sentiment Analyzer - External spreadsheet](https://docs.google.com/spreadsheets/d/1Jw-d2ihbjSyO4SyzgXSiC5dzs36GY5aMGxuf_nc7WKU/copy).
53+
1. Make a copy of the [News Sentiment Analyzer - External spreadsheet](https://docs.google.com/spreadsheets/d/1Jw-d2ihbjSyO4SyzgXSiC5dzs36GY5aMGxuf_nc7WKU/copy).
5754

5855
1. To open the associated Apps Script Project, at the top, click **Tools <span aria-label="and then">></span> Script editor**.
5956
1. Update the `Code.gs` script file with your API keys:
@@ -65,7 +62,7 @@ Copy and customize the solution with your API keys.
6562
1. At the top of the spreadsheet, click the custom menu item **News Headlines Sentiments**.
6663
1. Select **Analyze News Headlines**.
6764
* Note: Upon first run, you must go through the Google authorization steps. This leaves the script running, but paused. After you authorize the script, click **Dismiss**, and select **Analyze News Headlines** again.
68-
1. In the popup dialog, enter a news topic or keyword. For example `Global Warming`.
65+
1. In the dialog, enter a news topic or keyword. For example `Global Warming`.
6966
1. Click **Ok** to start the analysis.
7067

7168
## Next steps

0 commit comments

Comments
 (0)