ganesshkumar / obsidian-plugins-stats-ui

📊 This tool helps you explore and track Obsidian plugin ecosystem.
https://obsidian-plugin-stats.vercel.app
MIT License
55 stars 5 forks source link

[Feature Request] Changelog from tag description #22

Closed joethei closed 2 years ago

joethei commented 2 years ago

When I open one of my plugins on this website, no changelogs are provided https://obsidian-plugin-stats.vercel.app/plugins/link-favicon But as you can see from the GitHub repo, I do indeed provide changelogs. https://github.com/joethei/obsidian-link-favicon/releases

This comes from GitHub having two ways to provide changelogs:

Both look mostly identical to the user.

While the manually written changelog can be retrieved from the API, the tag description cannot.

You will need to parse the HTML on the following page: "https://github.com/" + plugin.Repo + "/releases/tag/" + release.GetTagName()" and look for the following selector: [data-test-selector=tag-info]

ganesshkumar commented 2 years ago

That's interesting. I guess there is an alternative approach to do this with the APIs instead of parsing HTML. Looks like if we don't provide the changelog manually, the fallback option is to fetch the commit message that belongs to the tag.

Tags API https://api.github.com/repos/joethei/obsidian-link-favicon/tags gives the list of tags along with the commit URL.

[
    {
        "name": "1.7.1",
        "zipball_url": "https://api.github.com/repos/joethei/obsidian-link-favicon/zipball/refs/tags/1.7.1",
        "tarball_url": "https://api.github.com/repos/joethei/obsidian-link-favicon/tarball/refs/tags/1.7.1",
        "commit": {
            "sha": "48074ce010afcee27191607a1b0907a0e2ddec92",
            "url": "https://api.github.com/repos/joethei/obsidian-link-favicon/commits/48074ce010afcee27191607a1b0907a0e2ddec92"
},
            "node_id": "REF_kwDOGeuUeK9yZWZzL3RhZ3MvMS43LjE"
    },
    ... 
]        

Following the commit URL, https://api.github.com/repos/joethei/obsidian-link-favicon/commits/48074ce010afcee27191607a1b0907a0e2ddec92, the node root > commit > message gives the message that you are targeting.

ganesshkumar commented 2 years ago

Will add the commit message as the fallback!

ganesshkumar commented 2 years ago

Fixed it. Please check, https://obsidian-plugin-stats.vercel.app/plugins/link-favicon

ganesshkumar commented 2 years ago

@joethei FYI on an unrelated point, if you add a tag link to your GitHub repository, the plugin will show in the similar plugins when users are visiting other plugins tagged with the same tag (There is already a plugin using the tag link. Hence, suggesting it)