diff --git a/.github/workflows/integrity.yml b/.github/workflows/integrity.yml
index efbf49c..2d387c1 100644
--- a/.github/workflows/integrity.yml
+++ b/.github/workflows/integrity.yml
@@ -3,7 +3,8 @@ name: integrity
# The weekly clock. `check.yml` only runs when someone edits the repo, so a list
# nobody is touching is a list nobody is checking, which is exactly when it rots.
# This job probes every link on a schedule, publishes the reading where a badge
-# can serve it, and keeps one issue whose title carries the count.
+# can serve it, keeps one issue whose title carries the count, and refreshes the
+# adoption page so a reader can filter the directory themselves.
on:
schedule:
@@ -36,6 +37,15 @@ jobs:
# 1 means dead links were found: that is the finding, not a crash.
if [ "$code" -gt 1 ]; then exit "$code"; fi
+ - name: restore the adoption cache from the health branch
+ run: |
+ mkdir -p scripts
+ curl -fsS "https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/health/scripts/adoption.json" \
+ -o scripts/adoption.json || echo "no cache yet, starting cold"
+
+ - name: measure how established each entry is
+ run: python3 scripts/adoption.py --max-age 7 || echo "adoption pass incomplete; keeping what it measured"
+
- name: publish the reading where the badge can read it
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -46,9 +56,11 @@ jobs:
# master takes pull requests only (the fleet main gate ruleset), so the
# reading lives on its own branch: raw.githubusercontent serves it there.
rm -rf "$RUNNER_TEMP/health"
- mkdir -p "$RUNNER_TEMP/health/assets"
+ mkdir -p "$RUNNER_TEMP/health/assets" "$RUNNER_TEMP/health/scripts"
cp health.json "$RUNNER_TEMP/health/assets/health.json"
cp assets/verified.json "$RUNNER_TEMP/health/assets/verified.json"
+ [ -f ADOPTION.md ] && cp ADOPTION.md "$RUNNER_TEMP/health/ADOPTION.md" || true
+ [ -f scripts/adoption.json ] && cp scripts/adoption.json "$RUNNER_TEMP/health/scripts/adoption.json" || true
cd "$RUNNER_TEMP/health"
git init -q
git checkout -q -b health
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..41193c7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+# generated by scripts/adoption.py; the canonical copy lives on the health branch
+ADOPTION.md
+scripts/adoption.json
+__pycache__/
diff --git a/README.md b/README.md
index 18680f9..e2f4ce5 100644
--- a/README.md
+++ b/README.md
@@ -22,8 +22,10 @@
New here? Start with the v6 manual, the PineCoders FAQ, or what runs Pine outside TradingView.
+How big is each one? Stars, boosts, age and reviews, measured, not claimed.
+
-Contents · 10 sections
+Contents · 11 sections
## Contents
@@ -41,6 +43,7 @@
- [Automated Order Execution](#automated-order-execution)
- [Open Source](#open-source)
- [Closed Source](#closed-source)
+- [Alerts & Notifications](#alerts--notifications)
- [Running Pine Outside TradingView](#running-pine-outside-tradingview)
- [Development Tools](#development-tools)
- [Style Guides & Best Practices](#style-guides--best-practices)
@@ -137,26 +140,23 @@
## Automated Order Execution
-- [PSStrategyX](https://www.tradingview.com/script/ZUqQdIKU-pAulseperformance-PSStrategyX/) - Backtests and automates indicators automatically.
+Every service below turns an alert into an order. The open-source ones you run yourself; the
+closed-source ones are accounts you point a webhook at.
### Open Source
#### Python
-- [Python Pine Bot Client](https://github.com/kzh-dev/pine-bot-client) - Client implementation of a trading bot that uses Pine Script and Python.
-- [Python TradingView TA](https://github.com/deathlyface/python-tradingview-ta) - Unofficial TradingView technical analysis API wrapper.
-- [Python Bybit Pine Bot](https://github.com/Mtemi/Bybit-Auto-Trading-Bot-Ordes-placed-via-TradingView-Webhook) - Places orders (buy, sell, close, manage positions, TP, SL, TS and so on) on Bybit from TradingView webhook JSON alerts.
-- [Python Webhook Alert Provider](https://github.com/fabston/TradingView-Webhook-Bot) - Listens to TradingView alerts via webhooks using Flask. All alerts can be instantly sent to Telegram, Discord, Twitter and/or email.
-- [OctoBot](https://octobot.online/) - Open-source cryptocurrency trading robot that can receive alerts and turn them into orders on your favorite crypto exchanges.
- [Misc Collection](https://github.com/Roibal/Cryptocurrency-Trading-Bots-Python-Beginner-Advance) - Various Python crypto bots, with a TradingView alert bot.
-- [Quantium Signal](https://github.com/quantium-ai/signal) - A self-hosted SMTP server that allows the use of TradingView alerts without the premium plan.
+- [OctoBot](https://octobot.online/) - Open-source cryptocurrency trading robot that can receive alerts and turn them into orders on your favorite crypto exchanges.
+- [Python Bybit Pine Bot](https://github.com/Mtemi/Bybit-Auto-Trading-Bot-Ordes-placed-via-TradingView-Webhook) - Places orders (buy, sell, close, manage positions, TP, SL, TS and so on) on Bybit from TradingView webhook JSON alerts.
+- [Python Pine Bot Client](https://github.com/kzh-dev/pine-bot-client) - Client implementation of a trading bot that uses Pine Script and Python.
- [TradingView Webhook Receiver](https://github.com/tradevectorsrobots/tradingview-webhook-receiver) - Self-hosted, dependency-free receiver that turns TradingView alerts into broker order requests, with a secret check, duplicate protection, size and price limits, a market-hours check, a kill switch and an audit log. Ships with a paper adapter only.
#### JavaScript
-- [Instabot Trader](https://github.com/ottodevs/instabot-trader) - Server-side bot that powers Alertatron: converts text messages sent over HTTP or via a Telegram bot into a set of trading orders on a variety of exchanges (Bitfinex, Deribit and Coinbase Pro).
- [Fundingrate Backend](https://github.com/tacyarg/tradingview-webhooks) - Backend service converting TradingView alerts into action.
-- [mkt-alerts](https://github.com/dzianisv/mkt-alerts) - Self-hosted CLI that evaluates Pine Script v5 indicators independently and delivers price, RSI, MACD and custom alerts via ntfy, email or Telegram.
+- [Instabot Trader](https://github.com/ottodevs/instabot-trader) - Server-side bot that powers Alertatron: converts text messages sent over HTTP or via a Telegram bot into a set of trading orders on a variety of exchanges (Bitfinex, Deribit and Coinbase Pro).
#### Google Chrome
@@ -165,7 +165,6 @@
### Closed Source
- [3Commas](https://3commas.io/) - Can receive TV alerts and connect them to their bots to execute simple orders on crypto exchanges.
-- [Alertatron](https://alertatron.com/) - Relays TradingView alerts to Telegram, Discord, Slack, email or webhooks, with a chart snapshot attached.
- [AlgoWay](https://algoway.trade/) - TradingView webhook automation for MT5, cTrader, TradeLocker, MatchTrader, DxTrade, Capital.com, IBKR, Binance, OKX, Bybit and other execution platforms.
- [Altrady](https://www.altrady.com/features/signal-bot) - You can run Pine Script strategies on TradingView that will automatically open positions based on the signal.
- [AutoView](https://autoview.with.pink/) - Free for testnets. Google Chrome extension that receives TV alerts and relays orders to crypto exchanges.
@@ -176,19 +175,29 @@
- [Mizar](https://www.mizar.com/) - Runs your TV strategies via webhooks, with fast and reliable execution across several crypto exchanges.
- [PickMyTrade](https://pickmytrade.trade/) - Automates TradingView strategies and indicators for futures, connecting TradingView with Tradovate and Rithmic.
- [Pine Connector](https://www.pineconnector.com/) - Auto-execute your TradingView alerts on MetaTrader 4 and 5.
-- [PineGen AI](https://www.pinegen.ai/) - Generates, fixes and backtests compiler-validated Pine Script v6 strategies from plain English.
- [ProfitView](https://wiki.profitview.app/home) - Google Chrome extension that receives TV alerts and relays orders to crypto exchanges.
-- [PSStrategyX](https://pinescriptstrategy.com/psstrategyx/) - Pine Script indicator that automatically connects to AutoView so you don't have to write alert syntax.
-- [Tickerly](https://tickerly.net/?partner=1898) - A fast and flexible service that enables you to automate any strategy on forex, stock, futures or cryptocurrency assets.
+- [PSStrategyX](https://www.tradingview.com/script/ZUqQdIKU-pAulseperformance-PSStrategyX/) - Indicator that backtests and then connects itself to AutoView, so you never write alert syntax by hand.
+- [Tickerly †](https://tickerly.net/?partner=1898) - A fast and flexible service that enables you to automate any strategy on forex, stock, futures or cryptocurrency assets.
- [TradeSanta](https://tradesanta.com/) - Automated trading software for TradingView.
- [Tradelab.ai](https://tradelab.ai/) - Free TradingView bot builder. Build the strategy you want, no compromises, no code skills required, free to start.
-- [TradersPost](https://traderspost.io/?via=1) - Stocks, options, futures, crypto and paper trading with TradingView webhooks.
+- [TradersPost †](https://traderspost.io/?via=1) - Stocks, options, futures, crypto and paper trading with TradingView webhooks.
- [TradingConnector](https://www.tradingconnector.com/) - TradingView alerts to MT4/MT5: converts TV alerts into instant orders on MT4/MT5 in forex, indices and commodities markets.
- [TradingView.to](https://tradingview.to/) - The simplest, most affordable and reliable automation tool.
- [TV Hub](https://www.tv-hub.org/) - Executes TradingView alerts as spot and futures orders on Binance, Bybit, OKX, KuCoin, Coinbase, Bitget and Hyperliquid, with position size, stop loss and take profit set per alert.
-
+† This link carries the maintainer's referral id. The list earns a small commission from it,
+and nothing about an entry is decided by that.
+
+## Alerts & Notifications
+
+Delivers the alert, and stops there, with no order attached. Kept apart from the section above
+because a reader looking for automation is not looking for a notifier.
+
+- [Alertatron](https://alertatron.com/) - Relays TradingView alerts to Telegram, Discord, Slack, email or a webhook, with a chart snapshot attached.
+- [mkt-alerts](https://github.com/dzianisv/mkt-alerts) - Self-hosted CLI that evaluates Pine Script v5 indicators independently and delivers price, RSI, MACD and custom alerts via ntfy, email or Telegram.
+- [Python Webhook Alert Provider](https://github.com/fabston/TradingView-Webhook-Bot) - Listens to TradingView alerts over a webhook with Flask and forwards them to Telegram, Discord, Twitter and email.
+- [Quantium Signal](https://github.com/quantium-ai/signal) - A self-hosted SMTP server that lets you use TradingView alerts without the premium plan.
## Running Pine Outside TradingView
@@ -208,11 +217,11 @@ The language used to be locked to the platform. These projects run a Pine script
- [Charts](https://chartsgg.com/pine-script-editor) - Runs Pine Script and MQL4/MQL5 indicators in the browser on any market, and exports Pine Script to MQL5.
- [Pine Script lookahead checker](https://github.com/Stochastly/stochastly-calculators/tree/main/pine-script-lookahead-checker) - Open-source static check that flags `request.security` calls using `lookahead_on` without a history offset, which leak higher-timeframe values into past bars.
- [Pine Script Pro](https://github.com/revanthpobala/pinescript-vscode-extension) - Professional language support for Pine Script: static analysis, type-infection checking and intelligent tooltips for advanced TradingView developers.
-- [Pineify](https://pineify.app/) - AI-assisted Pine Script v6 coding agent and visual no-code builder for indicators, strategies and screeners, with parameter optimization and backtest analysis.
-
-
-
-
+- [PineGen AI](https://www.pinegen.ai/) - Generates, fixes and backtests compiler-validated Pine Script v6 strategies from plain English.
+- [Pineify](https://pineify.app/) - AI-assisted Pine Script v6 coding agent and visual no-code builder for indicators, strategies and screeners, with parameter optimization and backtest.
+- [Python TradingView TA](https://github.com/deathlyface/python-tradingview-ta) - Unofficial TradingView technical analysis wrapper. Reads the ratings off a symbol's page, which is the cheapest way to get a second opinion into a script.
+- [TradingView MCP server](https://github.com/daviddme/tradingview-indicator-search-mcp-server) - Model Context Protocol server that searches TradingView's indicators and strategies and returns their Pine source, so an agent can read the code before it writes any.
+- [TradingView strategy optimizer](https://github.com/Roboquant-AI/tradingview-optimizer) - Open-source browser extension that grid-searches and walk-forward tests a strategy's inputs, and draws the result as a heatmap.
## Style Guides & Best Practices
- [Script Moderation](https://www.tradingview.com/chart/SSP/bquN1v9X-Script-Moderation-Q-A/) - How to not get banned.
diff --git a/scripts/adoption.py b/scripts/adoption.py
new file mode 100644
index 0000000..b77a313
--- /dev/null
+++ b/scripts/adoption.py
@@ -0,0 +1,301 @@
+#!/usr/bin/env python3
+"""Measure how established every entry is, so a reader can filter for themselves.
+
+The list is a directory: it names the options and lets the reader choose. This
+script supplies the half a reader cannot see at a glance, and it prints only
+numbers that have a public source:
+
+ GitHub stars, and the repository's own birthday, from the API
+ TradingView boosts, read off the script page
+ any domain first capture in the Wayback Machine, which gives "around since"
+ App Store average rating and count, from Apple's public search API
+ Trustpilot attempted, and recorded as blocked when it refuses (it does)
+
+Nothing here invents a user count. A closed service that publishes none shows a
+dash, and a dash is a fact about the evidence rather than about the service.
+
+ python3 scripts/adoption.py # refresh what is stale, write ADOPTION.md
+ python3 scripts/adoption.py --max-age 0 # re-measure everything
+ python3 scripts/adoption.py --limit 5 # smoke test on the first five entries
+
+The cache is scripts/adoption.json and it is written after every phase, so a run
+that is cut short keeps what it measured. Wayback results are memoised per HOST,
+because thirty entries share tradingview.com and it is the slowest source.
+"""
+
+import argparse
+import json
+import re
+import shutil
+import subprocess
+import sys
+import time
+from concurrent.futures import ThreadPoolExecutor
+from pathlib import Path
+from urllib.parse import quote, urlparse
+
+UA = ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 "
+ "(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36")
+ROOT = Path(__file__).resolve().parent.parent
+CACHE = ROOT / "scripts" / "adoption.json"
+OUT = ROOT / "ADOPTION.md"
+SKIP_SECTIONS = {"contents", "contributing"}
+# docs rather than products: tradingview.com's first capture says nothing about a manual
+RENDER_SKIP = {"official resources"}
+
+
+def curl(url, timeout=20):
+ try:
+ out = subprocess.run(["curl", "-sS", "-L", "--max-time", str(timeout), "-A", UA, url],
+ capture_output=True, text=True, timeout=timeout + 8)
+ return out.stdout, out.returncode
+ except subprocess.TimeoutExpired:
+ return "", 28
+
+
+def entries(markdown):
+ section, rows = None, []
+ for line in markdown.splitlines():
+ head = re.match(r"^##\s+(.+?)\s*$", line)
+ if head:
+ section = head.group(1).strip()
+ continue
+ item = re.match(r"^\s*-\s+\[(.+?)\]\((https?://[^)\s]+)\)\s*-\s*(.+)$", line)
+ if item and section and section.lower() not in SKIP_SECTIONS:
+ rows.append({"name": item.group(1), "url": item.group(2), "section": section})
+ return rows
+
+
+def github(url):
+ m = re.match(r"https?://github\.com/([^/]+/[^/#?]+)", url)
+ if not m:
+ return None
+ repo = m.group(1).removesuffix(".git")
+ body = ""
+ # The unauthenticated API allows 60 requests an hour per IP and this machine
+ # shares one, so carry a token when `gh` is on PATH and fall back to curl.
+ if shutil.which("gh"):
+ try:
+ body = subprocess.run(["gh", "api", f"repos/{repo}"], capture_output=True,
+ text=True, timeout=30).stdout
+ except subprocess.TimeoutExpired:
+ body = ""
+ if not body.lstrip().startswith("{"):
+ body, _ = curl(f"https://api.github.com/repos/{repo}")
+ if not body.lstrip().startswith("{"):
+ return None
+ try:
+ d = json.loads(body)
+ except json.JSONDecodeError:
+ return None
+ if "stargazers_count" not in d:
+ return None
+ return {"stars": d["stargazers_count"], "first": (d.get("created_at") or "")[:4]}
+
+
+def tradingview(url):
+ if "tradingview.com/script/" not in url:
+ return None
+ body, rc = curl(url)
+ m = re.search(r'aria-label="([\d,]+)\s+boost', body) if rc == 0 else None
+ return {"boosts": int(m.group(1).replace(",", ""))} if m else None
+
+
+def appstore(name):
+ """Average rating and count from Apple's public search API.
+
+ Matched on the app's name STARTING with the service's name, because a loose
+ search matches any app with a common word in it and would put a stranger's
+ rating next to an entry.
+ """
+ body, rc = curl(f"https://itunes.apple.com/search?term={quote(name)}&entity=software&limit=5")
+ if rc != 0:
+ return None
+ try:
+ results = json.loads(body).get("results", [])
+ except json.JSONDecodeError:
+ return None
+ want = re.sub(r"[^a-z0-9]", "", name.lower())
+ if len(want) < 4:
+ return None
+ for r in results:
+ got = re.sub(r"[^a-z0-9]", "", (r.get("trackName") or "").lower())
+ if got.startswith(want) and r.get("userRatingCount", 0) >= 20:
+ return {"app_score": round(float(r["averageUserRating"]), 1),
+ "app_count": int(r["userRatingCount"])}
+ return None
+
+
+def first_seen_host(host):
+ """Earliest Wayback capture for a host, or None. Slow and rate-limited."""
+ for attempt in (1, 2):
+ body, rc = curl(f"https://web.archive.org/cdx/search/cdx?url={host}&output=json"
+ f"&limit=1&fl=timestamp&filter=statuscode:200", timeout=25)
+ if rc == 0:
+ try:
+ # a CDX timestamp is fourteen digits (YYYYMMDDhhmmss), not eight
+ rows = json.loads(body)
+ stamp = rows[1][0]
+ if stamp[:4].isdigit():
+ return stamp[:4]
+ except (json.JSONDecodeError, IndexError, TypeError):
+ pass
+ time.sleep(1.5 * attempt)
+ return None
+
+
+def trustpilot(host):
+ body, rc = curl(f"https://www.trustpilot.com/review/{host}")
+ if rc != 0 or "trustScore" not in body:
+ return None
+ score = (re.search(r'"ratingValue"\s*:\s*"?([\d.]+)', body)
+ or re.search(r"trustScore[^0-9]*([\d.]+)", body))
+ count = (re.search(r'"reviewCount"\s*:\s*"?(\d+)', body)
+ or re.search(r"numberOfReviews[^0-9]*(\d+)", body))
+ if not (score and count):
+ return None
+ return {"score": float(score.group(1)), "count": int(count.group(1))}
+
+
+def save(cache, cache_path, rows):
+ cache_path.parent.mkdir(parents=True, exist_ok=True)
+ cache_path.write_text(json.dumps(cache, indent=1, sort_keys=True) + "\n", encoding="utf-8")
+
+
+def quick(row, max_age, cache):
+ key = row["url"]
+ old = cache.get(key, {})
+ if (time.time() - old.get("checked", 0)) < max_age * 86400:
+ return old
+ rec = {"name": row["name"], "url": key, "section": row["section"], "checked": int(time.time())}
+ gh = github(key)
+ if gh:
+ rec.update(gh)
+ else:
+ tv = tradingview(key)
+ if tv:
+ rec.update(tv)
+ store = appstore(row["name"])
+ if store:
+ rec.update(store)
+ for field in ("stars", "boosts", "first", "app_score", "app_count"):
+ if field in old and field not in rec:
+ rec[field] = old[field]
+ return rec
+
+
+def fmt(n):
+ return f"{n / 1000:.1f}k".replace(".0k", "k") if n >= 1000 else str(n)
+
+
+def render(rows, cache):
+ out = ["# Adoption and evidence", "",
+ "The list is a directory: it says what each resource is, and this page says how established",
+ "it is. Every number carries the date it was measured, and a dash means no public number",
+ "exists, which is a fact about the evidence rather than about the resource.", "",
+ "Sources: stars and a repository's birthday from the GitHub API, boosts from each TradingView",
+ "script page, the domain's first capture from the Wayback Machine's CDX index, and ratings",
+ "from Apple's public search API. `domain since` is when the DOMAIN first appeared, which is",
+ "not always when the service did: a domain that changed hands carries the older date.", ""]
+ current = None
+ for row in rows:
+ if row["section"].lower() in RENDER_SKIP:
+ continue
+ c = cache.get(row["url"], {})
+ if row["section"] != current:
+ current = row["section"]
+ out += ["", f"## {current}", "",
+ "| resource | evidence | domain since | reviewers |",
+ "| --- | --- | --- | --- |"]
+ bits = []
+ if c.get("stars") is not None:
+ bits.append(f"★ {fmt(c['stars'])} on GitHub")
+ if c.get("boosts") is not None:
+ bits.append(f"{fmt(c['boosts'])} boosts")
+ tp, rv = c.get("trustpilot"), "—"
+ if tp:
+ rv = f"Trustpilot {tp['score']} ({fmt(tp['count'])}, {time.strftime('%b %Y', time.gmtime(tp.get('checked', 0)))})"
+ elif c.get("app_score") is not None:
+ rv = f"App Store {c['app_score']} ({fmt(c['app_count'])})"
+ since = c.get("first")
+ if "tradingview.com" in row["url"]:
+ since = None # the host's first capture says nothing about a script published later
+ out.append(f"| [{row['name']}]({row['url']}) | {', '.join(bits) or '—'} | "
+ f"{since or '—'} | {rv} |")
+ out += ["", "---", "",
+ f"Measured {time.strftime('%d %B %Y', time.gmtime())} by `scripts/adoption.py`. A lookup that",
+ "is refused keeps its previous reading rather than dropping out, and Trustpilot refuses",
+ "scripted requests from this host, so its column fills only when a browser has read it.", ""]
+ return "\n".join(out)
+
+
+def main():
+ ap = argparse.ArgumentParser(description=__doc__)
+ ap.add_argument("--max-age", type=int, default=7)
+ ap.add_argument("--limit", type=int, default=0)
+ ap.add_argument("--out", default=str(OUT))
+ ap.add_argument("--cache", default=str(CACHE))
+ ap.add_argument("--skip-web", action="store_true")
+ args = ap.parse_args()
+
+ rows = entries((ROOT / "README.md").read_text(encoding="utf-8"))
+ if args.limit:
+ rows = rows[:args.limit]
+ cache_path = Path(args.cache)
+ cache = json.loads(cache_path.read_text(encoding="utf-8")) if cache_path.exists() else {}
+ stale = [r for r in rows if (time.time() - cache.get(r["url"], {}).get("checked", 0)) >= args.max_age * 86400]
+
+ print(f"{len(rows)} entries, {len(stale)} stale", flush=True)
+ with ThreadPoolExecutor(max_workers=8) as pool:
+ for row, rec in zip(rows, pool.map(lambda r: quick(r, args.max_age, cache), rows)):
+ cache.setdefault(row["url"], {}).update(rec)
+ save(cache, cache_path, rows)
+ print(f"pass 1 done: {sum(1 for r in rows if cache[r['url']].get('stars') is not None)} stars, "
+ f"{sum(1 for r in rows if cache[r['url']].get('boosts') is not None)} boosts", flush=True)
+
+ if not args.skip_web:
+ hosts = []
+ for r in stale:
+ h = urlparse(r["url"]).netloc.lower().removeprefix("www.")
+ if f"host:{h}" not in cache and h not in hosts and not cache[r["url"]].get("first"):
+ hosts.append(h)
+ print(f"wayback: {len(hosts)} hosts", flush=True)
+ for i, h in enumerate(hosts, 1):
+ year = first_seen_host(h)
+ cache[f"host:{h}"] = {"first": year, "checked": int(time.time())}
+ if i % 10 == 0:
+ save(cache, cache_path, rows)
+ print(f" {i}/{len(hosts)} ({sum(1 for x in hosts[:i] if cache[f'host:{x}'].get('first'))} answered)",
+ flush=True)
+ # archive.org throttles hard: a faster loop comes back empty, which
+ # reads exactly like a host with no captures
+ time.sleep(1.2)
+ for r in rows:
+ h = urlparse(r["url"]).netloc.lower().removeprefix("www.")
+ if cache[r["url"]].get("first") is None and cache.get(f"host:{h}", {}).get("first"):
+ cache[r["url"]]["first"] = cache[f"host:{h}"]["first"]
+ save(cache, cache_path, rows)
+ print("trustpilot: recorded as blocked when it refuses", flush=True)
+ for r in stale:
+ h = urlparse(r["url"]).netloc.lower().removeprefix("www.")
+ if cache.get(f"host:{h}", {}).get("tp_blocked"):
+ continue
+ got = trustpilot(h)
+ if got:
+ cache[r["url"]]["trustpilot"] = {**got, "checked": int(time.time())}
+ else:
+ cache[f"host:{h}"] = {**cache.get(f"host:{h}", {}), "tp_blocked": int(time.time())}
+ time.sleep(0.2)
+ save(cache, cache_path, rows)
+
+ Path(args.out).write_text(render(rows, cache), encoding="utf-8")
+ print(f"evidence: {sum(1 for r in rows if cache[r['url']].get('stars') is not None)} stars, "
+ f"{sum(1 for r in rows if cache[r['url']].get('boosts') is not None)} boosts, "
+ f"{sum(1 for r in rows if cache[r['url']].get('first'))} since, "
+ f"{sum(1 for r in rows if cache[r['url']].get('app_score') is not None)} app store, "
+ f"{sum(1 for r in rows if cache[r['url']].get('trustpilot'))} trustpilot -> {args.out}")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())