Created
August 29, 2016 03:13
-
-
Save JeffMatson/c08a81f829b2cadf2361a04c9f6b188b to your computer and use it in GitHub Desktop.
Shell script to get all plugins and details matching a name in the WordPress plugins repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Name, URL, Slug" | |
IFS=$'\n' # make newlines the only separator | |
for j in `curl https://wordpress.org/plugins/search.php?page=[1-12]\&q=gravity+forms | grep '<h4>.*</h4>'` | |
do | |
echo -n "$j" | awk 'BEGIN { FS = ">" } ; { print $3 }' | awk 'BEGIN { FS = "<" } ; { print $1 }' | sed 's/\&\;/\&/g' | tr -d "\n" | |
echo -n , | |
echo -n "$j" | awk 'BEGIN { FS = "\"" } ; { print $2 }' | tr -d "\n" | |
echo -n , | |
echo -n "$j" | awk 'BEGIN { FS = "\"" } ; { print $2 }' | awk 'BEGIN { FS = "\/" } ; { print $5 }' | tr -d "\n" | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment