From 091969e5702a7a805d9240327b226f7d51c6f737 Mon Sep 17 00:00:00 2001 From: Mohammad Twin Date: Tue, 31 Oct 2023 11:12:36 +0400 Subject: [PATCH 1/5] feat: twitter-bot readme updated --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index 7e4b7a2..5b03529 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,41 @@ [![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 + +``` + +# Run the server +python server.py + +# Run the worker +python worker.py + +``` + + +## 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 +``` From f30025295b20b7e2243cb21dc6d5f8bfc8cf4642 Mon Sep 17 00:00:00 2001 From: Mohammad Twin Date: Thu, 2 Nov 2023 16:21:39 +0400 Subject: [PATCH 2/5] feat: Readme.md updated --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b03529..d583eb1 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,24 @@ pip install -r requirements.txt ## Running the app ``` - # Run the server python server.py # Run the worker python worker.py +``` +You can quickly launch the application using `Docker Compose`: +``` +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: +``` +python3 cli.py [twitter-username] +``` ## Tests From 55848ec99d8efba84ee68c2a7e03a609f3f5e5a6 Mon Sep 17 00:00:00 2001 From: Mohammad Twin Date: Thu, 2 Nov 2023 16:36:00 +0400 Subject: [PATCH 3/5] fix: lint issue was fixed --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d583eb1..2826d16 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ ## 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. +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 From e8985d335f0e554b83e27e23fd2706cad8c2e248 Mon Sep 17 00:00:00 2001 From: Mohammad Twin Date: Thu, 2 Nov 2023 16:56:08 +0400 Subject: [PATCH 4/5] fix: lint issue was fixed --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2826d16..9b870a4 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Description -This repository contains an application that extracts data from Twitter based on many factors and saves it into a Neo4j graph database. +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. @@ -17,7 +17,7 @@ pip install -r requirements.txt ## Running the app -``` +```bash # Run the server python server.py @@ -26,14 +26,16 @@ 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] ``` From 4b909d3bfb9bb11b28453ee5ac9a763a7d03b181 Mon Sep 17 00:00:00 2001 From: Mohammad Twin Date: Thu, 2 Nov 2023 17:13:59 +0400 Subject: [PATCH 5/5] fix: lint issue was fixed --- cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli.py b/cli.py index 1043688..2b2192e 100644 --- a/cli.py +++ b/cli.py @@ -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: """ @@ -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}")