diff options
| author | CaptainJack2491 <jayrupnakawala@gmail.com> | 2026-01-09 18:37:34 +0000 |
|---|---|---|
| committer | CaptainJack2491 <jayrupnakawala@gmail.com> | 2026-01-09 18:37:34 +0000 |
| commit | 40da5b48beeda6418c802c65a0dc8bf85cc9aca4 (patch) | |
| tree | 4f43306abba9910aad98435580cb6506dae4a698 /scripts/generate_refrences | |
| parent | 46ee0a5914d8248976c7e2308ce16f32f1bd4783 (diff) | |
added scripts to get abstract and bibliography easily from papers
Diffstat (limited to 'scripts/generate_refrences')
| -rwxr-xr-x | scripts/generate_refrences | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/generate_refrences b/scripts/generate_refrences new file mode 100755 index 0000000..1d5ec25 --- /dev/null +++ b/scripts/generate_refrences @@ -0,0 +1,30 @@ +#!/bin/bash + +OUTPUT_FILE="../src/final/references.bib" +echo "Generating $OUTPUT_FILE..." + +# Clear the file if it exists +> "$OUTPUT_FILE" + +for file in ../papers/*.pdf; do + # Extract the arXiv ID (e.g., 2401.05566) + id=$(basename "$file" | grep -oE '[0-9]{4}\.[0-9]{4,5}') + + if [ -n "$id" ]; then + echo "Fetching BibTeX for ID: $id" + + # Fetch the BibTeX entry from arXiv's export service + # -L follows redirects + # -s is silent + curl -L -s "https://arxiv.org/bibtex/$id" >> "$OUTPUT_FILE" + + # Add a newline between entries + echo -e "\n" >> "$OUTPUT_FILE" + else + echo "Skipping non-arXiv file: $(basename "$file")" + fi +done + +echo "Done! Created $OUTPUT_FILE with $(grep -c "@article" "$OUTPUT_FILE") entries." + + |
