Skip to content

Commit

Permalink
Merge pull request #18 from TogetherCrew/feature/readme-update
Browse files Browse the repository at this point in the history
Feature/readme update
  • Loading branch information
cyri113 authored Nov 2, 2023
2 parents ccc6602 + 0bc3575 commit 88084a4
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,54 @@

[![Maintainability](https://api.codeclimate.com/v1/badges/639841a044d5a068ede1/maintainability)](https://codeclimate.com/github/TogetherCrew/twitter-bot/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/639841a044d5a068ede1/test_coverage)](https://codeclimate.com/github/TogetherCrew/twitter-bot/test_coverage)

## Description

This repository contains an application that extracts data from Twitter based on many factors and saves it into a Neo4j graph database.
The application can be used to collect a wide range of data, including tweets, users, hashtags, and relationships between them.
Once the data has been extracted, it can be used to perform a variety of analyses, such as Account overview, your account activity, audience response, and engagement by account.

## Installation

```bash
pip install -r requirements.txt
```

## Running the app

```bash
# Run the server
python server.py

# Run the worker
python worker.py
```

You can quickly launch the application using `Docker Compose`:

```bash
docker-compose -f docker-compose.example.yml up
```

## Running the CLI

To run the CLI, execute the following command from the root directory of the application:

```bash
python3 cli.py [twitter-username]
```

## Tests

To run all of the tests in the application, simply run the following command:

```bash
pytest tests
```

To view the coverage report in HTML format, run the following commands:

```bash
python3 -m coverage run --omit="tests/*" -m pytest tests
python3 -m coverage html
```
5 changes: 3 additions & 2 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
extract_and_save_user_information,
)

bold_style = "\033[1m"
end_style = "\033[0m"


def extract_and_save(user: tweepy.User) -> None:
"""
Expand Down Expand Up @@ -47,8 +50,6 @@ def extract_and_save(user: tweepy.User) -> None:

user = get_twitter_user(username=username)

bold_style = "\033[1m"
end_style = "\033[0m"
logging.info(f"{bold_style}Username:{end_style} {username}")
logging.info(f"{bold_style}UserId:{end_style} {user.id}")
logging.info(f"{bold_style}Starting the extraction process{end_style}")
Expand Down

0 comments on commit 88084a4

Please sign in to comment.