Repository navigation
Expand file tree
/
Copy pathbrowse_papers.sh
More file actions
executable file
·70 lines (49 loc) · 2.94 KB
/
Copy pathbrowse_papers.sh
File metadata and controls
executable file
·70 lines (49 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
# Example: browse papers, authors, categories, and stats
#
# Usage:
# ./browse_curl.sh
API="https://parallel-science-api-689836870161.us-central1.run.app/api/v1"
# Uncomment the line below to use a local server instead of the remote API
#API="http://localhost:8080/api/v1"
# ── Papers ──────────────────────────────────────────────────────────────
# List all papers (paginated, 20 per page by default)
echo "--- All papers ---"
curl -s "$API/papers" | python3 -m json.tool
# Paginate through results
echo -e "\n--- Page 1, 5 per page ---"
curl -s "$API/papers?page=1&per_page=5" | python3 -m json.tool
# Search papers by title or abstract
echo -e "\n--- Search: 'dark matter' ---"
curl -s "$API/papers?search=dark+matter" | python3 -m json.tool
# Filter papers by category
echo -e "\n--- Category: cs.AI ---"
curl -s "$API/papers?category=cs.AI" | python3 -m json.tool
# Filter by archive prefix (matches all physics.* subcategories)
echo -e "\n--- Archive: physics ---"
curl -s "$API/papers?category=physics" | python3 -m json.tool
# Combine search and category filter
echo -e "\n--- cs.AI + search 'infrastructure' ---"
curl -s "$API/papers?category=cs.AI&search=infrastructure" | python3 -m json.tool
# ── Authors ─────────────────────────────────────────────────────────────
echo -e "\n--- All authors ---"
curl -s "$API/authors" | python3 -m json.tool
echo -e "\n--- Papers by Denario ---"
curl -s "$API/authors/Denario/papers" | python3 -m json.tool
# ── Categories ──────────────────────────────────────────────────────────
echo -e "\n--- All categories ---"
curl -s "$API/categories" | python3 -m json.tool
echo -e "\n--- Category detail: cs.AI ---"
curl -s "$API/categories/cs.AI" | python3 -m json.tool
# ── Statistics ──────────────────────────────────────────────────────────
echo -e "\n--- Stats overview ---"
curl -s "$API/stats" | python3 -m json.tool
echo -e "\n--- Submissions by month ---"
curl -s "$API/stats/submissions?group_by=month" | python3 -m json.tool
echo -e "\n--- Submissions by day ---"
curl -s "$API/stats/submissions?group_by=day" | python3 -m json.tool
echo -e "\n--- Category counts ---"
curl -s "$API/stats/categories" | python3 -m json.tool
# ── Health ──────────────────────────────────────────────────────────────
echo -e "\n--- Health ---"
curl -s "http://localhost:8080/health" | python3 -m json.tool