import json,urllib.request as u,sys def call(args,name='find_bounties'): r=u.Request('https://poidh.xyz/api/mcp',data=json.dumps({"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":name,"arguments":args}}).encode(),headers={'Content-Type':'application/json','Accept':'application/json, text/event-stream','User-Agent':'darwin-lab/1.0'}) d=json.load(u.urlopen(r,timeout=60)) return json.loads(d['result']['content'][0]['text']) if __name__=='__main__': x=call({'query':'agent','limit':5}) print(json.dumps(x)[:1800]) # ---- step 2: crawl (query 'a','e','o','i','the', limit 50, follow nextCursor; dedupe by chain+id) ---- import sys,json allr={};anch={} for q in ['a','e','o','i','the']: cur=None for _ in range(100): a={'query':q,'limit':50} if cur: a['cursor']=cur try:x=call(a) except Exception as e: print('err',q,e);break b=x['bounties'] if not b:break for r in b: allr[(r['chain'],r['id'])]=r cur=x.get('nextCursor') if cur: anch[(b[-1]['chain'],b[-1]['id'])]=int(cur) if not cur:break print(q,len(allr),flush=True) json.dump({'rows':[dict(v) for v in allr.values()],'anch':[[k[0],k[1],v] for k,v in anch.items()]},open('/tmp/poidh/all2.json','w')) # ---- step 3: flag + claims ---- rows=json.load(open('/tmp/poidh/all2.json'))['rows'] strict=re.compile(r'\b(ai agents?|autonomous agent|agents?,? |x402|openclaw|erc-?8004|mcp|skill\.md|agent-?to-?agent|for agents)\b',re.I) fl=[r for r in rows if strict.search(r['title']+' '+r['description']) and r['id']>=1380] print(len(fl)) selfid=re.compile(r"\b(autonomous|ai agent|i am an? (ai|agent)|as an agent|openclaw|claude|darwin)\b",re.I) out=[];bm=collections.defaultdict(lambda:[0,0,0,set()]) for r in fl: try:x=call({'chain':r['chain'],'id':r['id']},'get_bounty') except Exception as e: continue m=datetime.datetime.utcfromtimestamp(int(x['createdAt'])).strftime('%Y-%m') cl=x.get('claims') or [] b=bm[m];b[0]+=1;b[1]+=len(cl) for c in cl: b[3].add(c['issuerAddress']) if selfid.search((c.get('title') or '')+' '+(c.get('description') or '')): b[2]+=1 out.append((m,r['id'],len(cl))) for m in sorted(bm):b=bm[m];print(m,'bounties',b[0],'claims',b[1],'selfid-claims',b[2],'distinct claimants',len(b[3]))