Skip to content

Instantly share code, notes, and snippets.

@anthonykasza
Created September 14, 2015 01:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonykasza/3dbf4c3cdbf81d9ac605 to your computer and use it in GitHub Desktop.
Save anthonykasza/3dbf4c3cdbf81d9ac605 to your computer and use it in GitHub Desktop.
A basic BASH script for searching Github for new and interesting repos
if [ -z ${1+x} ]; then
printf "usage: search.sh terms.txt\n\n";
exit -1;
fi
DT=$(date '+%Y-%m-%d' --date="yesterday")
RESULTS_DIR="./results"
EMAIL=""
if [ ! -d "${RESULTS_DIR}" ]; then
mkdir "${RESULTS_DIR}"
fi
while read -r TERM; do
curl -s -G https://api.github.com/search/repositories \
--data-urlencode "q=\"${TERM}\" in:name,description,readme created:>${DT}" \
-H "Accept: application/vnd.github.preview" \
| jq ".items[] | {name, description, language, watchers_count, html_url}" \
> "${RESULTS_DIR}/${TERM}_${DT}.txt"
mail -s "${TERM} - New Github Repos" "${EMAIL}" < "${RESULTS_DIR}/${TERM}_${DT}.txt"
done < ${1}
malware protocol
malware communication
network traffic
reverse engineer
exploit kit
indicator of compromise
network forensics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment