Skip to content

Instantly share code, notes, and snippets.

@foospidy
Last active February 25, 2019 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save foospidy/d4a3c3c248a59eaec328760753784549 to your computer and use it in GitHub Desktop.
Save foospidy/d4a3c3c248a59eaec328760753784549 to your computer and use it in GitHub Desktop.
Copy a signal to all sites in Signal Sciences
#!/usr/bin/env bash
###################
# Signal Sciences helper script:
# sigsci-copy-custom-siganl.sh
# For a given site and tagName, the script will copy that signal to all sites.
# Requires:
# - pysigsci (https://pypi.org/project/pysigsci/)
# - jq (https://stedolan.github.io/jq/)
if [ -z $1 ];
then
echo "Usage: ./sigsci-copy-custom-signal.sh <site> <tagName>"
exit
fi
if [ -z $2 ];
then
echo "Usage: ./sigsci-copy-custom-signal.sh <site> <tagName>"
exit
fi
JSON=`pysigsci --get custom-signals --site ${1} | jq ".data[] | select(.tagName == \"${2}\")"`
pysigsci --add custom-signals --all-sites --data "$JSON"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment