Skip to content

Commit

Permalink
- Add setup instructions to the README (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinCullar authored Sep 27, 2024
1 parent 7291e51 commit 7116790
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ Sentiment analysis is performed on the comment text using the 'nltk' (Natural
Language Toolkit) python library. This data is added to the database entries of
each comment.

## Setup Instructions
1. Install `python3`
2. Create your python virtual environment with `python3 -m venv <env name>`
3. Install the packages in the `src/requirements.txt` file to your virtual
environment with `pip install -r requirements.txt`.
4. Create a file in the `/src` directory called `.env`. This file should contain
The following values:
```
API_KEY=<key> # your YouTube Data API key
DB_FILE=<filename> # the database file to which collected data will be written
LOG_LEVEL=[debug|info|warn|error]
```
For information about how to create an API key, see [here](https://blog.hubspot.com/website/how-to-get-youtube-api-key).
5. Run the tool with `python astro.py <YouTube video URL>` to start collecting
data. You can see output from an example run in the next section.

## Example
This output below was generated by providing the video ID string of a relatively
small YouTube channel.
Expand All @@ -34,31 +50,14 @@ DEBUG:astro.py:main: Collected data preview:

## Background
YouTube has been a primary source of information and entertainment in my house
for years now. Recently when looking at the comments of various videos, I've
noticed what I feel is strange behavior. However, I am not someone who regularly
engages with social media in that way, so this project is my attempt to
investigate and understand the behavior I see online.
for years. I've found that when reading comments on YouTube videos, I'm often
perplexed by the content there. Wanting to understand this behavior, whether it
was the product of real users or bots, I started researching social media usage.
This project is my attempt to gather data from YouTube videos and their comments
in order to analyze trends in the data, if any, in an effort to better
understand YouTube commenting behavior and its impact on video performance.

The name 'Astro' was chosen as a short form of 'Astroturf', a term used to
describe artificial social movements, since I was initially working toward
identifying bot campaigns. I've since decided to restrict the scope of the
project (at least for now), since that goal will require much more research.

## Prerequisites
These packages are required in order to run this tool.

- YouTube Data API
Used for accessing YouTube data. Install with:
`pip install google-api-python-client`

- dotenv
Used for loading environment variables from a local .env file. Install with:
`pip insatll python-dotenv`

- pandas
Used for capturing YouTube data in dataframes (for now). Install with:
`pip install pandas`

- Natural Language Toolkit
Used for sentiment analysis of comments. Install with:
`pip insatll nltk`

0 comments on commit 7116790

Please sign in to comment.