Sign inSign up

dougtrajano/toxicity-crawler

By dougtrajano

•Updated over 4 years ago

Crawler job that scrapes toxic comments from social media.

Image
0

578

dougtrajano/toxicity-crawler repository overview

⁠Toxicity comments crawler

Quality Gate Status

Crawler job that scrapes comments from social media posts and saves them in a S3 bucket.

Twitter

Tweets and replies are scraped from Twitter API for a given list of users.

Twitch

Coming soon.

YouTube

Coming soon.

Facebook

Coming soon.

Instagram

Coming soon.

The toxic level of a given comment is calculated using the Perspective API⁠.

⁠Architecture

Pending

⁠Usage

To run the crawler, you need to provide the following environment variables:

VariableDescriptionDefaultRequired
AWS_ROLE_ARNAWS Role ARNNoneOptional
AWS_WEB_IDENTITY_TOKEN_FILEAWS Web Identity Token FileNoneOptional
AWS_ACCESS_KEY_IDAWS Access Key IDNoneOptional
AWS_SECRET_ACCESS_KEYAWS Secret Access KeyNoneOptional
AWS_S3_BUCKETAWS S3 BucketNoneRequired
AWS_S3_BUCKET_PREFIXAWS S3 Bucket PrefixNoneRequired
LOG_LEVELLog levelINFOOptional
PERSPECTIVE_API_KEYPerspective API KeyNoneRequired
PERSPECTIVE_THRESHOLDPerspective Threshold0.5Required
FILTER_TOXIC_COMMENTSFilter Toxic CommentsTrueRequired
TWITTER_CONSUMER_KEYTwitter Consumer KeyNoneRequired
TWITTER_CONSUMER_SECRETTwitter Consumer SecretNoneRequired
TWITTER_ACCESS_TOKENTwitter Access TokenNoneRequired
TWITTER_ACCESS_TOKEN_SECRETTwitter Access Token SecretNoneRequired
TWITTER_MAX_TWEETSTwitter Max Tweets or repliesNoneRequired

If AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE are provided, the crawler will use them to assume a role, and will not use AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY.

⁠Running

⁠Prerequisites

Then, you can run the crawler with the following command:

docker run --env-file .env -d dougtrajano/toxicity-crawler:latest

⁠License

The project is licensed under the Apache 2.0 License⁠.

Tag summary

Content type

Image

Digest

Size

129.3 MB

Last updated

over 4 years ago

docker pull dougtrajano/toxicity-crawler