AspireSync/bin/popular-themes
Chuck Adams 5fcc4b8eb8
update popular themes/plugins scripts for subversion repo archival (#48)
* wip: use revision as dir hash for archive files

* tweak: slightly more verbose output

* tweak: quote directory being removed

* tweak: prettier header

* fix: use -e because lolbash

* tweak: add countdown-timer to blacklist

* fix: refactor blacklist and anchor the patterns

* feat: popular-plugins and popular-themes now output json

* refactor: mv svn/bin/popular-* bin/

* feat: trunk-only builds

* tweak: add more huge slugs before populating them scientifically

* wip: add some more unscientific slugs

* tweak: add 10M+ archive files to the 'huge' pile

* tweak:  update huge and add facebook-album-sync to corrupt

* feat: add IMMEDIATES_DEPTH to support empty checkouts

* fix: svn update missing directories automatically

* feat: specifically throw woocommerce into the trunk-only bin

* fix: drop __trunk entries from trunk-only

* refactor: break trunk-only.txt out from script source

* fix: use grep and not bash regex for trunk-only test

* tweak: add font-awesome-the-easy-way to corrupt

* update: update trunk-only.txt with more slugs

* tweak: show depth used, as trunk-only is now the norm

* tweak: break out suffix generation into function

* feat: new update-trunk-archive which will replace update-archive

* tweak: get tags before trunk

* zap: rm update-archive

* tweak: less noisy banner

* feat: sync popular plugins and themes on every run
2025-02-18 15:10:20 -07:00

28 lines
687 B
Bash
Executable file

#!/bin/bash
n=${1:-100}
endpoint=https://api.wordpress.org/themes/info/1.2/
fields=${FIELDS:-'slug,version,name'} # theme api doesn't even have a last_updated
[[ -n $EXTRA_FIELDS ]] && fields="$fields,$EXTRA_FIELDS"
exec curl --silent "$endpoint?action=query_themes&browse=popular&per_page=$n" | jq -r ".themes[] | {$fields}"
# curl --silent "https://api.wordpress.org/themes/info/1.2/?action=query_themes&browse=popular&per_page=$n" | jq -r '.themes[0] | keys[]'
# author
# description
# external_repository_url
# external_support_url
# homepage
# is_commercial
# is_community
# name
# num_ratings
# preview_url
# rating
# requires
# requires_php
# screenshot_url
# slug
# version