هذا المشروع يهدف إلى بناء نظام لمراقبة وتفاعل مع موقع الويب AADL3. النظام يمكن المستخدم من فتح عدة متصفحات، التحقق من حالة صفحات الويب، وأخذ لقطات شاشة للمراقبة. بالإضافة إلى ذلك، يتم إرسال تنبيهات عبر Telegram في حالة حدوث تغييرات في محتوى الصفحة.
- Node.js: تحميل وتثبيت Node.js من الرابط الرسمي.
- Git: تحميل وتثبيت Git من الرابط الرسمي.
- Node.js:
sudo apt update sudo apt install nodejs sudo apt install npm
- Git:
sudo apt install git
-
تنزيل الكود:
git clone https://github.com/TerminalDZ/AADL3-Website-Monitor.git cd AADL3-Website-Monitor
-
تثبيت التبعيات:
npm install
-
تشغيل التطبيق:
npm start
-
الوصول إلى الواجهة: افتح متصفح الإنترنت وانتقل إلى:
http://localhost:3000
- src/ : الكود الرئيسي لتشغيل التطبيق.
- public/: الملفات الثابتة التي تخدم الواجهة الأمامية.
- .env: ملف تكوين البيئة لتعيين المتغيرات البيئية.
- info.txt: ملف البيانات لإدارة السجلات.
- اضغط على زر "Start New Browser".
- اختر عدد المتصفحات (1-9).
- اضغط على "Start".
اضغط على زر "Stop All Browsers".
اضغط على زر "Take All Screenshot".
- اضغط على زر "Data Cards" لعرض السجلات.
- لإضافة سجل جديد، اضغط على زر "Add Data" وأدخل البيانات.
- اضغط على زر "Auto Fill" بجانب المتصفح المطلوب.
- حدد البيانات التي تريد ملؤها في النموذج من القائمة المنسدلة التي تظهر.
- سيتم ملؤها تلقائيًا وسيتم تقديم البيانات.
يتم استعادة المتصفحات عند إعادة تحميل الصفحة تلقائيًا.
- افتح تطبيق Telegram وابحث عن المستخدم @BotFather.
- ابدأ محادثة مع @BotFather وأرسل الأمر
/start
. - لإنشاء بوت جديد، أرسل الأمر
/newbot
. - اتبع التعليمات لتسمية البوت والحصول على اسم مستخدم (username) فريد له.
- بعد إكمال الخطوات، ستحصل على رمز توكن البوت (API token). هذا هو
TELEGRAM_TOKEN
.
- افتح تطبيق Telegram وابحث عن البوت الذي قمت بإنشائه.
- ابدأ محادثة مع البوت وأرسل أي رسالة.
- افتح المتصفح وانتقل إلى الرابط التالي مع استبدال
TELEGRAM_TOKEN
برمز التوكن الخاص بك:https://api.telegram.org/bot<TELEGRAM_TOKEN>/getUpdates
- ابحث في الاستجابة (response) عن
chat
وستجدid
. هذا هوCHAT_ID
.
- تأكد من ضبط متغيرات
TELEGRAM_TOKEN
وCHAT_ID
بقيم صحيحة في الكود .env الخاص بك.
إذا واجهت أي مشاكل، يرجى فتح تذكرة في مستودع GitHub.
إذا واجهت خطأ متعلق بـ ChromeDriver
، يمكنك محاولة حل المشكلة باتباع الخطوات التالية:
-
تحديث ChromeDriver:
- تأكد من أن إصدار ChromeDriver يتطابق مع إصدار Google Chrome المثبت على جهازك.
- قم بتنزيل أحدث إصدار من ChromeDriver من الرابط الرسمي واستبدل الإصدار الحالي في مسار مشروعك.
-
ضبط مسار ChromeDriver:
- إذا لم يتم العثور على
ChromeDriver
تلقائيًا، يمكنك تحديد المسار الكامل لـChromeDriver
في الكود الخاص بك:
const puppeteer = require('puppeteer-extra'); const chromePath = '/path/to/chromedriver'; // استبدل هذا بالمسار الفعلي لـ ChromeDriver puppeteer.launch({ executablePath: chromePath });
- إذا لم يتم العثور على
-
منح الأذونات اللازمة (Linux فقط):
- تأكد من أن
ChromeDriver
لديه أذونات التنفيذ:
sudo chmod +x /path/to/chromedriver
- تأكد من أن
باتباع هذه الخطوات، يجب أن تكون قادرًا على حل أي مشكلات تتعلق بـ ChromeDriver
وتشغيل المشروع بنجاح.
This project aims to build a system to monitor and interact with the AADL3 website. The system allows users to open multiple browsers, check the status of web pages, and take screenshots for monitoring. Additionally, alerts are sent via Telegram if there are changes in the page content.
- Node.js: Download and install Node.js from the official website.
- Git: Download and install Git from the official website.
- Node.js:
sudo apt update sudo apt install nodejs sudo apt install npm
- Git:
sudo apt install git
-
Clone the repository:
git clone https://github.com/TerminalDZ/AADL3-Website-Monitor.git cd AADL3-Website-Monitor
-
Install dependencies:
npm install
-
Run the application:
npm start
-
Access the interface: Open your web browser and go to:
http://localhost:3000
- src/: Main code to run the application.
- public/: Static files serving the frontend interface.
- .env: Environment configuration file to set environment variables.
- info.txt: Data file for managing records.
- Click the "Start New Browser" button.
- Select the number of browsers (1-9).
- Click "Start".
Click the "Stop All Browsers" button.
Click the "Take All Screenshot" button.
- Click the "Data Cards" button to view records.
- To add a new record, click the "Add Data" button and enter the information.
- Click the "Auto Fill" button next to the desired browser.
- Select the data you want to fill the form with from the dropdown that appears.
- The form will be filled automatically and the data will be submitted.
Browsers are restored automatically upon page reload.
- Open the Telegram app and search for the user @BotFather.
- Start a conversation with @BotFather and send the
/start
command. - To create a new bot, send the
/newbot
command. - Follow the instructions to name the bot and get a unique username.
- After completing the steps, you will receive the bot's API token. This is your
TELEGRAM_TOKEN
.
- Open the Telegram app and search for the bot you created.
- Start a conversation with the bot and send any message.
- Open your browser and go to the following URL, replacing
TELEGRAM_TOKEN
with your bot's token:https://api.telegram.org/bot<TELEGRAM_TOKEN>/getUpdates
- Look in the response for
chat
and find theid
. This is yourCHAT_ID
.
- Ensure that
TELEGRAM_TOKEN
andCHAT_ID
variables are set correctly in the code in your .env file.
If you encounter any issues, please open a ticket in the GitHub repository.
If you encounter an error related to ChromeDriver
, you can try solving the problem by following these steps:
-
Update ChromeDriver:
- Ensure that the ChromeDriver version matches the version of Google Chrome installed on your machine.
- Download the latest version of ChromeDriver from the official website and replace the current version in your project path.
-
Set ChromeDriver Path:
- If
ChromeDriver
is not found automatically, you can specify the full path toChromeDriver
in your code:
const puppeteer = require('puppeteer-extra'); const chromePath = '/path/to/chromedriver'; // Replace with the actual path to ChromeDriver puppeteer.launch({ executablePath: chromePath });
- If
-
Grant Necessary Permissions (Linux only):
- Ensure that
ChromeDriver
has execution permissions:
sudo chmod +x /path/to/chromedriver
- Ensure that
By following these steps, you should be able to resolve any issues related to ChromeDriver
and successfully run the project.