Skip to content

Commit

Permalink
remove telethon and format readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Aneuris Tavarez De Jesus authored and Luis Aneuris Tavarez De Jesus committed Oct 28, 2023
1 parent 636a80d commit 9a80102
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,46 @@
# WebScrapperRoBot
Simple Web scrapper Bot to scrap webpages using Requests, html5lib and Beautifulsoup.

# Setting Up a Project and Configuring Environment Variables

To set up the project and configure environment variables, follow these steps:

Clone the Repository:
### 1. Clone the Repository

Clone the project's repository from your preferred version control platform (e.g., Git) to your local machine.

Virtual Environment (Optional):
### 2. Virtual Environment (Optional)

It's a good practice to create a virtual environment for the project. You can use virtualenv or venv for this purpose.

bash
Copy code
```bash
python -m venv venv
source venv/bin/activate # On Unix/Linux systems
Install Dependencies:
Use pip to install the project's dependencies from the requirements.txt file.

3. Install Dependencies
Use pip to install the project is dependencies from the requirements.txt file.
bash
Copy code
pip install -r requirements.txt
Create the .env File:
Create a .env file in the project's root directory. This file will contain the necessary environment variables. You can either copy a sample file or create it manually.

Configure Environment Variables:
4. Create the .env File
Create a .env file in the project is root directory. This file will contain the necessary environment variables. You can either copy a sample file or create it manually.

5. Configure Environment Variables
Open the .env file and set the required environment variables in the format VARIABLE_NAME=value. For example:

env
Copy code
BOT_TOKEN=your_bot_token_here
API_ID=your_api_id_here
API_HASH=your_api_hash_here
Run the Project:

6. Run the Project
Execute the project using the appropriate command (e.g., python my_project.py) and access your environment variables in the code to retrieve configurations.

Consider Secret Management (Optional):
If you deploy your project on a cloud server, consider using a secrets manager like AWS Secrets Manager, Google Secret Manager, or a similar service. This will help you securely store your configurations in a production environment.
7. Consider Secret Management (Optional)

By following these steps, you can set up and run your project while keeping your environment variables and sensitive configurations protected.
If you deploy your project on a cloud server, consider using a secrets manager like AWS Secrets Manager, Google Secret Manager, or a similar service. This will help you securely store your configurations in a production environment.

<Br><b>Mark your Star ⭐⭐<b>

Expand Down
2 changes: 0 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from bs4 import BeautifulSoup
import requests
import os
from telethon.sync import TelegramClient as Client
import shutil
from urllib.parse import quote
from dotenv import load_dotenv
Expand All @@ -27,7 +26,6 @@
if bot_token is None or api_id is None or api_hash is None:
raise ValueError("Please set the BOT_TOKEN, API_ID, and API_HASH environment variables.")

app = Client("WebScrapperBot", bot_token=bot_token, api_id=int(api_id), api_hash=api_hash)


REPO = 'https://github.com/nuhmanpk/WebScrapper/'
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ requests
beautifulsoup4
html5lib
telegraph
telethon
python-dotenv

0 comments on commit 9a80102

Please sign in to comment.