Skip to content

Instantly share code, notes, and snippets.

@selftaught
Last active June 29, 2023 16:57
Show Gist options
  • Save selftaught/2d0a5942c798660b6125601e0901fe67 to your computer and use it in GitHub Desktop.
Save selftaught/2d0a5942c798660b6125601e0901fe67 to your computer and use it in GitHub Desktop.
#!/bin/bash
rm -rf plugins
mkdir plugins
for i in $(seq 1 2); do
curl -s "https://wordpress.org/plugins/browse/popular/page/$i/" | \
grep --color "https://wordpress.org/plugins/" | \
grep "<h3 class=\"entry-title\">" | sed "s/.*a href=\"//g" | sed "s/\" rel.*//g" | \
xargs -I{} curl -s {} | grep downloadUrl | grep -Eo "https:[^\"]+" | \
xargs -I{} wget -P plugins {}
done
cd plugins && ls -1 | sed 's/.zip//g' | xargs -I{} /bin/bash -c 'mkdir {} ; unzip "{}.zip" -d {}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment