Skip to content

Instantly share code, notes, and snippets.

@RamadhanAmizudin
Created December 15, 2023 12:33
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 RamadhanAmizudin/226806fac635e4beba4e8da49598182c to your computer and use it in GitHub Desktop.
Save RamadhanAmizudin/226806fac635e4beba4e8da49598182c to your computer and use it in GitHub Desktop.
Pull list of popular wordpress plugin
import requests
page = 1
url = "https://api.wordpress.org:443/plugins/info/1.2/?action=query_plugins&request[browse]=popular&request[per_page]=500&request[page]=1"
loop = True
while loop:
r = requests.get(url)
rj = r.json()
for plugin in rj['plugins']:
if plugin['active_installs'] >= 50000:
print("+---")
print("| Name: " + str(plugin['name']))
print("| Short Description: " + str(plugin['short_description']))
print("| Version: " + str(plugin['version']))
print("| Active Installs: " + str(plugin['active_installs']))
print("| Last Update: " + str(plugin['last_updated']))
print("| URL: " + str(plugin['download_link']))
print("+---")
else:
loop = False
if rj['info']['pages'] > page:
url = "https://api.wordpress.org:443/plugins/info/1.2/?action=query_plugins&request[browse]=popular&request[per_page]=500&request[page]=" + str(rj['info']['page'] + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment