Парсер позволяет собирать информацию о товарах, услугах и ценах, предлагаемых на платформе FunPay.com. Парсер осуществляет автоматический сбор данных с сайта и сохраняет полученную информацию в Гугл Таблицах и отсылает сообщения о товарах в Telegram бота.
Для работы скрипта нужен NodeJS. Скачиваем его и устанавливаем.
- Скачиваем репозиторий в любую удобную для вас папку.
- Открываем терминал PowerShell и вводим туда команду
cd путь\до\вашей\папки. - Следующая команда
npm install. - Открываем Гугл Таблицы, создаем новую таблицу.
- Переходим во вкладку
Расширения > Apps Scripts. Как открылось окно редактора скриптов вставляем туда код из файлаappScripts.js. - Следуем советам из комментариев в коде этого скрипта. Вставляем ссылку на свою созданную таблицу и название листа.
- Открываем Telegram, входим в свой аккаунт. В поиске ищем @BotFather.
- Создаем нового бота командой
/newbot. Задаем ему любое имя. После создания копируем токен выданный ботом. Вставляем его в функциюsendBotMessageв переменнуюtoken. - Открываем бота @getmyid_bot и копируем id пользователя. Вставляем его в функцию
sendBotMessageв переменнуюchannel. - Справа сверху в AppsScripts нажимаем кнопку Начать развертывание > Новое развертывание. Описание оставляем пустым, доступ выставляем на Все. Копируем выданную ссылку.
- Открываем файл
main.jsи находим переменнуюURL_APP. В значение этой переменной вставляем скопированную ссылку. - Находим строку
await page.goto('###############');и вместо # вставляем ссылку на нужный товар. Например: https://funpay.com/chips/2. - При необходимости спускаемся ниже и меняем валюту и стоимость за единицу товара.
- Открываем терминал PowerShell и вводим команду
npm run start. - Наслаждаемся работой скрипта.
The parser allows you to gather information about products, services, and prices offered on the FunPay.com platform. The parser automatically collects data from the website and saves the obtained information in Google Sheets, as well as sends messages about products to a Telegram bot.
To work with the script, you need NodeJS. Download and install it.
- Download the repository to any convenient folder.
- Open PowerShell terminal and enter the command
cd path\to\your\folder. - Run the command
npm install. - Open Google Sheets, create a new spreadsheet.
- Go to the
Extensions > Apps Scripts. When the script editor window opens, paste the code from the fileappScripts.jsinto it. - Follow the recommendations in the comments of this script. Insert the link to your created spreadsheet and the sheet name.
- Open Telegram, log in to your account. Search for @BotFather.
- Create a new bot with the command
/newbot. Give it any name. After creation, copy the token provided by the bot. Paste it into thesendBotMessagefunction in thetokenvariable. - Open the @getmyid_bot bot and copy the user ID. Paste it into the
sendBotMessagefunction in thechannelvariable. - In AppsScripts, click the button Deploy > New Deployment at the top right. Leave the description empty and set access to Anyone. Copy the provided URL.
- Open the
main.jsfile and find theURL_APPvariable. Paste the copied URL as the value of this variable. - Find the line
await page.goto('###############');and replace the # with the link to the desired product. For example: https://funpay.com/chips/2. - If necessary, scroll down and change the currency and unit cost of the product.
- Open PowerShell terminal and enter the command
npm run start. - Enjoy the script's functionality.