Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dslucas committed Nov 29, 2022
1 parent 4cb1f8d commit 755af33
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 31 deletions.
64 changes: 42 additions & 22 deletions docs/1_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,60 @@ of developers.

## 1. Get access to Twitter APIs

**NOTE: The full suite of Twitter APIs the app uses require additional access
beyond the default Twitter API [Essential access
level](https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api).
The [Enterprise
search](https://developer.twitter.com/en/docs/twitter-api/enterprise/search-api/overview)
additionally requires an [enterprise
account](https://developer.twitter.com/en/docs/twitter-api/enterprise/search-api/overview).**

**NOTE: We plan to migrate the Enterprise Full-Archive Search API to the v2 Search Tweets
in the future. We will update this documentation accordingly.**

The app makes use of several Twitter APIs, including:

- [The Enterprise Full-Archive Search
API](https://developer.twitter.com/en/docs/twitter-api/enterprise/search-api/overview) to fetch
tweets directed at the logged in user
- The v2 [blocks](https://developer.twitter.com/en/docs/twitter-api/users/blocks/introduction)
- The [Enterprise Full-Archive Search
API](https://developer.twitter.com/en/docs/twitter-api/enterprise/search-api/overview)
**or** the [v2 Full-Archive Search
endpoint](https://developer.twitter.com/en/docs/twitter-api/tweets/search/quick-start/full-archive-search)
to fetch tweets directed at the logged in user
- The v2
[blocks](https://developer.twitter.com/en/docs/twitter-api/users/blocks/introduction)
endpoint to block users on behalf of the authenticated user
- The v2 [mutes](https://developer.twitter.com/en/docs/twitter-api/users/mutes/introduction)
- The v2
[mutes](https://developer.twitter.com/en/docs/twitter-api/users/mutes/introduction)
endpoint to mute users on behalf of the authenticated user
- The v2 [hide
replies](https://developer.twitter.com/en/docs/twitter-api/tweets/hide-replies/introduction)
endpoint to hide replies on behalf of the authenticated user

To support all this functionality, you'll need to [get access to the Twitter
API](https://developer.twitter.com/en/docs/twitter-api/getting-started/getting-access-to-the-twitter-api)
and the Enterprise Full-Archive Search API.
API](https://developer.twitter.com/en/docs/twitter-api/getting-started/getting-access-to-the-twitter-api).

Once granted, take note of the:
**NOTE: The full suite of Twitter APIs the app uses require additional access
beyond the default Twitter API [Essential access
level](https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api).
The [Enterprise
search](https://developer.twitter.com/en/docs/twitter-api/enterprise/search-api/overview)
API requires an [enterprise
account](https://developer.twitter.com/en/docs/twitter-api/enterprise/search-api/overview),
while v2 Full-Archive Search requires [academic
access](https://developer.twitter.com/en/products/twitter-api/academic-research).**

- Account name, app key, and app secret for your Twitter API developer account
- Username and password for your Enterpise Full-Archive Search API account
Once granted access, take note of the:

You'll need both sets of credentials later on.
- Account name, app key, and app secret for your Twitter API developer account
- If using the Enterprise Full-Archive Search API, the Username and password for
your enterprise account
- If using the v2 Full-Archive Search endpoint, the Twitter bearer token for
your app

You'll need these credentials later on.

### Enterprise Full-Archive Search vs. v2 Full-Archive Search

The tool is implemented in a way that either API can be used. While both APIs
offer similar functionality, there are key differences in rate limits. We refer
users to [Twitter's
comparison](https://developer.twitter.com/en/docs/twitter-api/tweets/search/migrate)
for more details. You may also see minute differences in:

- Which tweets are fetched. This is due to differences in granularity for
timestamp format each API supports (YYYYMMDD for Enterprise and
YYYY-MM-DDTHH:mm:ssZ for v2).
- The order the tweets are displayed when sorted by "Priority". This is due to
small differences in how the APIs return the tweet text, which causes some
variation in the Perspective API scores for the text.

## 2. Create a Google Cloud Platform (GCP) project

Expand Down
32 changes: 23 additions & 9 deletions docs/2_development.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,12 @@ The required fields are:

The optional fields are:

- `twitterApiCredentials`: Your credentials for the Twitter APIs. The server
expect this field to be an object with `accountName`, `username`, and
`password` fields for the Enterprise Search API and `appKey` and `appToken`
for the Standard API.
- `twitterApiCredentials`: Your credentials for the Twitter APIs.

All together, your config should look something like the config below, with the
relevant credentials and key values replaced.
All together, your config should look something like one of the two configs
below, with the relevant credentials and key values replaced.

### If using the Enteprise Full-Archive Search API:

```json
{
Expand All @@ -166,12 +165,27 @@ relevant credentials and key values replaced.
"accountName": "{TWITTER_API_ACCOUNT_NAME}",
"username": "{TWITTER_API_USERNAME}",
"password": "{TWITTER_API_PASSWORD}",
"appKey": "{APP_KEY}",
"appToken": "{APP_TOKEN}"
"appKey": "{TWITTER_APP_KEY}",
"appToken": "{TWITTER_APP_TOKEN}"
}
}
```

### If using the v2 Full-Archive Search endpoint:

````json
{
"port": "3000",
"staticPath": "dist/harassment-manager",
"googleCloudApiKey": "{YOUR_GOOGLE_CLOUD_API_KEY}",
"cloudProjectId": "{YOUR_GOOGLE_CLOUD_PROJECTID}",
"twitterApiCredentials": {
"appKey": "{TWITTER_APP_KEY}",
"appToken": "{TWITTER_APP_TOKEN}",
"bearerToken": "{TWITTER_APP_BEARER_TOKEN}"
}
}

## 7. (Optional) Enable Google Analytics

If you created a Google Analytics property in [setup](1_setup.md) and want to
Expand All @@ -192,7 +206,7 @@ To build and run the app and a local development server, run

```shell
npm run build:all:dev && npm run start:dev-server
```
````

To build and run the app and a local production server, run

Expand Down

0 comments on commit 755af33

Please sign in to comment.