-
Notifications
You must be signed in to change notification settings - Fork 0
Generation Script
Alex edited this page Jun 19, 2025
·
1 revision
#!/bin/bash
BBLU='\033[1;34m'
BGRE='\033[1;32m'
BPUR='\033[1;35m'
RST='\033[0m'
BTT='<p align="center"><a href="#top"><img src="https://img.shields.io/badge/Back%20to%20top--lightgrey?style=social" alt="Back to top" height="20"/></a></p>'
OPT="--creds-file ~/.zotero/creds-drone.txt"
function write-section(){
cat export.md >> README.md
rm -f export.md
echo -e "\n\n$BTT" >> README.md
}
if [ "$1" == "-r" ] || [ $# -gt 1 ]; then
echo -e "${BPUR}Updating Zotero CLI's local cache...${RST}"
zotero-cli $OPT reset
fi
# Introduction and table of contents
echo -e "${BBLU}Creating README.md...${RST}"
cat << EOF > README.md
# Awesome Drone Hacking <a id="top" href="https://x.com/intent/tweet?text=Awesome%20Drone%20Hacking%20-%20A%20curated%20list%20of%20resources%20related%20to%20drone%20hacking.%0D%0Ahttps%3a%2f%2fgithub%2ecom%2fdronesploit%2fawesome-drone-hacking%0D%0A&hashtags=awesomelists,drone,hacking,cybersecurity,infosec"><img src="https://img.shields.io/badge/Tweet--lightgrey?logo=x&style=social" alt="Tweet" height="20"/></a>
> A curated list of resources related to drone hacking containing references to books, papers, blog posts, and other written resources but also tools for interacting with various drones.
## Contents
- [:books: Literature](#books-literature)
- [Documentation](#documentation)
- [Scientific Research](#scientific-research)
- [:wrench: Tools](#wrench-tools)
EOF
# Bibliography section
echo -e "${BBLU}Adding section 'Literature'...${RST}"
echo -e "\n\n\n## :books: Literature\n" >> README.md
echo -e "\n### Documentation\n" >> README.md
zotero-cli $OPT export title date url itemType -f "collections:Documentation" -s "title" -l "{emoji} {link_lower}" -o md -u
write-section
echo -e "\n### Scientific Research\n" >> README.md
zotero-cli $OPT export title date url itemType rank^4 -f "collections:Bibliography" -s "title" -l "{emoji} {link_lower} ({date}) {stars}" -o md -u
write-section
# Tools section
echo -e "${BBLU}Adding section 'Tools'...${RST}"
echo -e "\n\n\n## :wrench: Tools\n" >> README.md
zotero-cli $OPT export title url abstractShortNote -f "collections:Tools" -s "title" -l "{link_with_abstract}" -o md -u
write-section
# Contribute section
echo -e "${BBLU}Adding section 'Contribute'...${RST}"
echo -e "\n\n\n## Contributing\n\nContributions are welcome! Please read the [contribution guidelines](CONTRIBUTING.md) first.\n\n" >> README.md
# Awesome-lint check
echo -e "${BBLU}Checking the list...${RST}"
npx awesome-lint README.md
echo -e "${BGRE}DONE${RST}"