main icon indicating copy to clipboard operation
main copied to clipboard

Consider "scraping" GitLab instances for extracting a developer's or packager's pretty name

Open Olf0 opened this issue 3 years ago • 4 comments

From the discussion for PR #80, point 2c:

For obtaining a name at GitLab, as a fallback the URL might be parsed, though this provides the login name, not the pretty name, see, e.g.: https://gitlab.com/Olf0/sailfishX Although the pretty name can be extracted as the first string on a GitLab user page proper (when ignoring GitLab's top menu bar), see, e.g.: https://gitlab.com/Olf0

Note that I believe to remember that the pretty name can be left empty: IMO it makes sense to use the login name as a fallback, then.

As discussed for points 2a & 2b (not yet concluded), it might make sense to query the ultimately determined source code repository (out of {m_repo_url, m_url}) for the developer's name and the m_packaging_repo_url for the packager's name.

Side note: In general I do not like web-page "scraping", because web-pages are often altered. But in this case, I believe that the pretty name will very likely always be right below the avatar picture, so this is a sustainable solution.

Olf0 avatar Apr 14 '22 00:04 Olf0

No, I would avoid scraping. We are using GitLab GraphGL API. If there is a call to get "Pretty name" we can use it, if there is none then we better skip pretty name. There is a fallback anyway as it can be specified in Chum section of the SPEC.

rinigus avatar Apr 14 '22 19:04 rinigus

We are using GitLab GraphGL API. If there is a call to get "Pretty name" we can use it, […]

I assumed there is none, because retrieving the pretty name via API was not implemented for GitLab, in contrast to GitHub. For sure using a defined API is always better than "web-page scraping".

No, I would avoid scraping.

Well, that was what point 2c of PR https://github.com/sailfishos-chum/main/pull/80 was all about, due to my "jumping to conclusions".

Olf0 avatar Apr 15 '22 00:04 Olf0

In my mind it was about parsing URL :)

rinigus avatar Apr 15 '22 06:04 rinigus