ALGORITHM - Execute steps in order, try ALL fallbacks before giving up:
STEP 1: GitHub API with full title
curl -s 'https://api.github.com/search/repositories?q=FULL+PAPER+TITLE' | python3 -c "import sys,json; items=json.load(sys.stdin).get('items',[]); print(items[0]['html_url'] if items else 'NOT_FOUND')"
-> If found, verify: curl -s -o /dev/null -w '%{http_code}' URL (must be 200)
-> If verified, DONE. Otherwise continue to step 2.
STEP 2: GitHub API with acronym/keywords (if full title fails)
Extract key words or acronym from title (e.g., 'STAIR', 'locate-3d', 'deepcluster')
curl -s 'https://api.github.com/search/repositories?q=ACRONYM' | python3 -c "import sys,json; items=json.load(sys.stdin).get('items',[]); print(items[0]['html_url'] if items else 'NOT_FOUND')"
-> Verify with curl, if 200 -> DONE
STEP 3: Arxiv + PDF extraction (if GitHub search fails)
Find on arxiv
curl -s 'http://export.arxiv.org/api/query?search_query=all:PAPER+TITLE&max_results=1' | grep -o 'http://arxiv.org/abs/[0-9.v]*'
Download PDF
curl -L -o paper.pdf 'http://arxiv.org/pdf/ARXIV_ID'
Extract github link
pip install PyPDF2 -q
python3 -c "import PyPDF2,re; f=open('paper.pdf','rb'); r=PyPDF2.PdfReader(f); text=''.join(p.extract_text() or '' for p in r.pages); m=re.search(r'https://github\.com/[^\\s]+',text); print(m.group(0) if m else 'NOT_FOUND')"
-> Verify with curl, if 200 -> DONE
STEP 4: If ALL steps fail, return empty string "" (not a guess!)
KEY: Iterate through ALL steps. Do not stop after step 1 fails. Empty > wrong.