Skip to content

Instantly share code, notes, and snippets.

@Pross
Created July 5, 2014 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pross/22305cce8e7b1a26b00c to your computer and use it in GitHub Desktop.
Save Pross/22305cce8e7b1a26b00c to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "" > spam.txt
for url in $(wp site list --field=url)
do
for id in $(wp --url=$url post list --field=ID)
do
printf ":"
content=$(wp --url=$url post get $id --field=content)
if [[ $content =~ .*viagra.* ]]
then
echo $url >> spam.txt
printf '[s]'
elif [[ $content =~ .*pharma.* ]]
then
echo $url >> spam.txt
printf '[s]'
else
printf '.'
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment