You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 7, 2023. It is now read-only.
* 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>
Copy file name to clipboardExpand all lines: news-sentiment/README.md
+15-18Lines changed: 15 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Analyze the sentiment of news headlines retrieved for a user-specif
4
4
labels: Apps Script, Sheets, Cloud Natural Language
5
5
material_icon: Feed
6
6
create_time: 2021-03-22
7
-
update_time: 2021-03-29
7
+
update_time: 2021-03-30
8
8
---
9
9
10
10
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
21
21
## Try it
22
22
23
23
### 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/).
25
25
26
26
#### Get the Google Cloud Natural Language API key
27
27
28
28
To get an API key for the Google Cloud Natural Language API, you must configure a Google Cloud Platform (GCP) project.
29
29
30
-
1. Create a new or use an existing GCP project:
31
-
1. Navigate to the main {{console_name_short}} page.
* 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 <spanclass=”material-icons”>menu</span> <spanaria-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 <spanclass=”material-icons”>menu</span> <spanaria-label="and then">></span> **APIs & Services**.
37
+
1. Click **+ Enable APIs and Services**.
42
38
1. Search for `Cloud Natural Language API`, and enable it.
43
39
1. On the left, click **Credentials** <spanaria-label="and then">></span> **+ Create credentials**.
44
40
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
46
44
47
-
#### Register for the News API key.
48
45
To get an API key for the News API, you need to create a free News API account.
49
46
1. To create an account, go to the [News API](https://newsapi.org/) site.
50
47
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.
53
50
### Create your copy of the solution
54
51
Copy and customize the solution with your API keys.
55
52
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).
57
54
58
55
1. To open the associated Apps Script Project, at the top, click **Tools <spanaria-label="and then">></span> Script editor**.
59
56
1. Update the `Code.gs` script file with your API keys:
@@ -65,7 +62,7 @@ Copy and customize the solution with your API keys.
65
62
1. At the top of the spreadsheet, click the custom menu item **News Headlines Sentiments**.
66
63
1. Select **Analyze News Headlines**.
67
64
* 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`.
0 commit comments