Detect if plugin has been deprecated and move to new "Discontinued plugins"
Edit This originally referred to Deprecated but we're going to use Discontinued instead, as a more commonly used word.
One comment about this is that I've seen "Deprecated" not-well-understood even by people whose first language is English.
It would be nice if we could find a more commonly-understood word.
To know whether a plugin has been archived or not, one needs to use the GitHub API:
import requests
repo = "user/plugin-name"
headers = {"Accept": "application/vnd.github.v3+json"}
response = requests.get(
"https://api.github.com/repos/{}".format(repo), headers=headers
)
r = response.json()
is_archived = r.get("archived")
Since the API has a rate limit, and we exceed the 60 requests per hour for unauthenticated users just with the plugins, we'll need to set up GitHub actions or personal access tokens for the terminal.
Ways to tell if a plugin has been discontinued:
- The repo no longer exists (or is private)
- The repo has been archived
- The repo has been removed from obsidian-releases/community-plugins.json