Skip to content

appsfolder/gsmarbot

Repository files navigation

gsmarbot

Русский README

Telegram inline bot for searching mobile device specifications. The bot uses GSMArena/Helpix parsing, local SQLite caching, fuzzy search and per-user settings.

This repository is intended as a self-hosted open-source release. The original public Telegram instance @gsmarbot is being sunset because it is too expensive and inconvenient to maintain as a constantly running public service.

Hosted API

If you only need device data, use the maintained hosted API:

https://gsmarbot.ru/docs

The API is maintained and works independently from the main Telegram bot. It already contains parsed device data, so in most cases you do not need to run your own bot, parser, or local database.

The API server code is not included in this open-source repository. The public bot code also does not include the API dashboard, API key creation, or the /api Telegram command.

Features

  • Telegram inline search powered by Telethon.
  • Fuzzy local search over cached device records.
  • GSMArena and Helpix parsers.
  • SQLite storage for cache, settings, and device submissions.
  • Per-user bot settings.

Requirements

  • Python 3.11+
  • Telegram bot token from BotFather
  • Telegram API ID/hash from https://my.telegram.org
  • SQLite, included with Python

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

Fill .env with your Telegram credentials and optional runtime settings. The application reads configuration from environment variables:

set -a
source .env
set +a

Run

python bot.py

Configuration

Important environment variables:

  • TELEGRAM_BOT_TOKEN, TELEGRAM_TEST_BOT_TOKEN
  • TELEGRAM_API_ID, TELEGRAM_API_HASH for telethon
  • GSMARBOT_DB_PATH, defaults to gsmarbot.db
  • GSMARBOT_SOURCE_URL, defaults to https://github.com/appsfolder/gsmarbot
  • PROXY_URLS as an optional comma-separated proxy list

Runtime files are intentionally ignored by git: SQLite databases, Telethon sessions, logs, API key JSON files, proxy lists, local caches, and private API service code.

Project Structure

  • bot.py - Telegram bot entry point.
  • bot_state.py - compatibility helpers around SQLite state.
  • modules/config.py - environment-driven runtime configuration.
  • modules/db.py - SQLite schema and data access.
  • modules/parserengine.py - web search and device page parsing.
  • modules/fuzzengine.py - local fuzzy search.
  • modules/articlesbuilder.py, modules/keyboardbuilder.py, modules/reformer.py - Telegram inline UI formatting.
  • modules/utils.py - small shared helpers.
  • site/ - static pages and hosted API documentation.
  • misc/ - localization and supporting data.

License

MIT

About

Simple inline Telegram bot for GSMArena phone specifications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors