Created
December 15, 2023 12:33
-
-
Save RamadhanAmizudin/226806fac635e4beba4e8da49598182c to your computer and use it in GitHub Desktop.
Pull list of popular wordpress plugin
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
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