{"id":"ff7740e5-c7dc-4850-b5c2-b43660b92fc4","slug":"clawhub-534422530-laosi-webhook-receiver","name":"Webhook Receiver Pro","description":"Webhook接收 - 本地HTTP服务接收和处理webhook事件，支持日志记录、事件过滤、自动重试","canonicalUrl":"https://www.xpersona.co/agent/clawhub-534422530-laosi-webhook-receiver","sourceUrl":"https://clawhub.ai/534422530/laosi-webhook-receiver","homepage":"https://clawhub.ai/534422530/skills/laosi-webhook-receiver","source":"CLAWHUB","vendor":{"slug":"clawhub","label":"Clawhub","url":"https://clawhub.ai/534422530/skills/laosi-webhook-receiver"},"protocols":["OPENCLEW"],"capabilities":[],"trustScore":null,"trustConfidence":"unknown","artifactCount":0,"benchmarkCount":0,"lastRelease":"2.0.0","freshnessAt":"2026-10-11T16:20:28.180Z","freshnessLabel":"Oct 11, 2026","securityReviewed":true,"openapiReady":false,"stats":[{"label":"Trust score","value":"Unknown"},{"label":"Compatibility","value":"OpenClaw"},{"label":"Freshness","value":"Oct 11, 2026"},{"label":"Vendor","value":"Clawhub"},{"label":"Artifacts","value":"0"},{"label":"Benchmarks","value":"0"},{"label":"Last release","value":"2.0.0"}],"factsPreview":[{"factKey":"vendor","category":"vendor","label":"Vendor","value":"Clawhub","href":"https://clawhub.ai/534422530/skills/laosi-webhook-receiver","sourceUrl":"https://clawhub.ai/534422530/skills/laosi-webhook-receiver","sourceType":"profile","confidence":"medium","observedAt":"2026-10-11T16:20:28.193Z","isPublic":true},{"factKey":"protocols","category":"compatibility","label":"Protocol compatibility","value":"OpenClaw","href":"https://www.xpersona.co/api/v1/agents/clawhub-534422530-laosi-webhook-receiver/contract","sourceUrl":"https://www.xpersona.co/api/v1/agents/clawhub-534422530-laosi-webhook-receiver/contract","sourceType":"contract","confidence":"medium","observedAt":"2026-10-11T16:20:28.193Z","isPublic":true},{"factKey":"traction","category":"adoption","label":"Adoption signal","value":"1K downloads","href":"https://clawhub.ai/534422530/laosi-webhook-receiver","sourceUrl":"https://clawhub.ai/534422530/laosi-webhook-receiver","sourceType":"profile","confidence":"medium","observedAt":"2026-10-11T16:20:28.193Z","isPublic":true},{"factKey":"latest_release","category":"release","label":"Latest release","value":"2.0.0","href":"https://clawhub.ai/534422530/laosi-webhook-receiver","sourceUrl":"https://clawhub.ai/534422530/laosi-webhook-receiver","sourceType":"release","confidence":"medium","observedAt":"2026-05-29T23:31:42.021Z","isPublic":true},{"factKey":"handshake_status","category":"security","label":"Handshake status","value":"UNKNOWN","href":"https://www.xpersona.co/api/v1/agents/clawhub-534422530-laosi-webhook-receiver/trust","sourceUrl":"https://www.xpersona.co/api/v1/agents/clawhub-534422530-laosi-webhook-receiver/trust","sourceType":"trust","confidence":"medium","observedAt":null,"isPublic":true}],"highlights":["1K downloads","Trust evidence available"],"agentCard":{"name":"Webhook Receiver Pro","description":"Webhook接收 - 本地HTTP服务接收和处理webhook事件，支持日志记录、事件过滤、自动重试","source":"CLAWHUB","sourceId":"clawhub:s170k9770tgh0506hw0dwtb6pd83kwyq:laosi-webhook-receiver","homepage":"https://clawhub.ai/534422530/skills/laosi-webhook-receiver","repository":"https://clawhub.ai/534422530/laosi-webhook-receiver","documentation":"https://www.xpersona.co/agent/clawhub-534422530-laosi-webhook-receiver","protocols":["OPENCLEW"],"examples":[{"kind":"example","language":"python","snippet":"import os, json, hashlib, hmac\nfrom datetime import datetime\nfrom http.server import HTTPServer, BaseHTTPRequestHandler\nfrom typing import Callable, Dict, List, Optional\n\nWEBHOOK_LOG = os.path.join(os.path.dirname(__file__), \"webhook_logs.json\")\n\nclass WebhookEvent:\n    def __init__(self, headers: dict, body: str, source: str = \"unknown\"):\n        self.headers = headers\n        self.body = body\n        self.source = source\n        self.timestamp = datetime.now().isoformat()\n        self.id = hashlib.sha256(body.encode()).hexdigest()[:16]\n        self.parsed = self._parse_body()\n    \n    def _parse_body(self) -> dict:\n        try:\n            return json.loads(self.body)\n        except json.JSONDecodeError:\n            return {\"raw\": self.body[:200]}\n    \n    def to_dict(self) -> dict:\n        return {\n            \"id\": self.id,\n            \"source\": self.source,\n            \"timestamp\": self.timestamp,\n            \"headers\": self.headers,\n            \"parsed\": self.parsed,\n        }\n\nclass WebhookReceiver:\n    def __init__(self, log_file: str = None):\n        self.log_file = log_file or WEBHOOK_LOG\n        self.handlers: Dict[str, Callable] = {}\n        self.events: List[dict] = self._load_events()\n        os.makedirs(os.path.dirname(self.log_file), exist_ok=True)\n    \n    def _load_events(self) -> list:\n        if os.path.exists(self.log_file):\n            try:\n                with open(self.log_file, encoding=\"utf-8\") as f:\n                    return json.load(f).get(\"events\", [])\n            except (json.JSONDecodeError, ValueError):\n                return []\n        return []\n    \n    def _save_events(self):\n        with open(self.log_file, \"w\", encoding=\"utf-8\") as f:\n            json.dump({\"events\": self.events[-500:]}, f,\n                      ensure_ascii=False, indent=2)\n    \n    def register_handler(self, event_type: str, handler: Callable):\n        \"\"\"注册事件处理函数\"\"\"\n        self.handlers[event_type] = handler\n    \n    def receive(self, event: WebhookEvent) -"},{"kind":"example","language":"python","snippet":"def verify_webhook(payload, signature, secret):\n    \"\"\"GitHub/Stripe webhook签名验证\"\"\"\n    import hmac, hashlib\n    expected = \"sha256=\" + hmac.new(\n        secret.encode(), payload.encode(), hashlib.sha256\n    ).hexdigest()\n    return hmac.compare_digest(expected, signature)"}]}}