project screenshot 1
project screenshot 2
project screenshot 3

Shop Bot

PriceAlert: Track Amazon, Walmart and more. Get XMTP alerts! Compare prices with Walmart, all in one sleek web app. Never miss a deal again. Built with Flask, Node.js, and XMTP for real-time messaging.

Shop Bot

Created At

ETHOnline 2024

Project Description

PriceAlert is an innovative web application designed to revolutionize the way online shoppers track and compare product prices. This project combines the power of web scraping, real-time messaging, and price comparison to provide users with a seamless and efficient shopping experience. Key Features and Functionality: Amazon Product Tracking: Users can input any Amazon product URL into the system. The application then utilizes Selenium WebDriver to scrape essential product information, including the product name, current price, and image. Real-time Display: The scraped information is immediately displayed on the web interface, giving users instant access to the product details they're interested in. 3. XMTP Integration: One of the standout features of PriceAlert is its integration with XMTP (Extensible Message Transport Protocol). This allows the system to send real-time alerts and updates directly to users. Price Alerts: The system sends an initial message via XMTP containing the product details and current price. This sets up the foundation for future price drop alerts. Walmart Price Comparison: To provide users with more options, PriceAlert automatically generates a Walmart search link for the same product. After a short delay (10 seconds in the current implementation), it sends a follow-up XMTP message with this link, encouraging users to compare prices across platforms. User-Friendly Interface: The web interface, built with Flask, offers a clean and intuitive design. Users can easily input URLs, view product information, and understand the alerts they'll receive. Scalable Architecture: The project is split into two main components - a Flask server (app.py) for handling web requests and scraping, and a Node.js server (xmtp_service.js) for XMTP messaging. This separation of concerns allows for easier scaling and maintenance. Technical Implementation: The Flask server (app.py) handles the web interface and Amazon scraping. It uses Selenium for dynamic web scraping, ensuring accurate and up-to-date product information. The Node.js server (xmtp_service.js) manages all XMTP communications. It creates random wallets for each message, ensuring user privacy and system flexibility. The project leverages the power of both Python and JavaScript, showcasing the ability to integrate different technologies for optimal performance. Future Potential: PriceAlert has significant potential for expansion. Future versions could include: Support for more e-commerce platforms User accounts for personalized tracking Historical price data and trend analysis Integration with cryptocurrency payments for direct purchases Mobile app version for on-the-go price tracking In summary, PriceAlert is not just a price tracker; it's a comprehensive shopping companion that leverages cutting-edge technologies to provide users with real-time, cross-platform price comparisons and alerts. By combining web scraping, decentralized messaging, and a user-friendly interface, PriceAlert stands out as an innovative solution in the e-commerce space.

How it's Made

Core Technologies:

  1. Python & Flask: The backbone of our web application is built using Flask, a lightweight Python web framework. Flask handles routing, request processing, and serves the HTML template. Selenium WebDriver: We use Selenium with Python for web scraping Amazon product pages. Selenium allows us to interact with dynamic web content, crucial for accurately extracting product information from Amazon's JavaScript-heavy pages. Node.js & Express: A separate Node.js server handles the XMTP messaging service. Express.js is used to create a simple API endpoint for receiving product information from the Flask server. XMTP.js: We integrate the XMTP protocol for decentralized messaging. This allows us to send price alerts without relying on traditional email or SMS services.
  2. Ethers.js: Used in conjunction with XMTP for creating random Ethereum wallets for each message. Architecture and Data Flow: Web Interface (Flask): Users input an Amazon URL into a form on the index.html page. A POST request is sent to the Flask server when the form is submitted. Web Scraping (Selenium): The Flask server uses Selenium to navigate to the provided Amazon URL. We extract the product name, price, and image URL using Selenium's WebDriverWait and CSS selectors.
  3. Data Processing: Extracted data is formatted into a JSON object. This data is both sent back to the frontend for display and forwarded to the XMTP service. XMTP Integration (Node.js): The Flask server sends a POST request to the Node.js server with the product information. The Node.js server creates a random Ethereum wallet for each message (a particularly "hacky" but privacy-preserving feature). An initial XMTP message is sent with the product details. A setTimeout function is used to send a follow-up message with a Walmart link after 10 seconds. Challenges and Hacks:
  4. Cross-Origin Resource Sharing (CORS): We implemented CORS in the Node.js server to allow requests from the Flask application. Headless Browser: We use a headless Chrome instance for scraping, which significantly improves performance. Random Wallet Generation:
background image mobile

Join the mailing list

Get the latest news and updates