Fix scraping for GitHub's new Primer-React profile shell + fix of hunter.io search issues#68
Open
soxoj wants to merge 2 commits into
Open
Fix scraping for GitHub's new Primer-React profile shell + fix of hunter.io search issues#68soxoj wants to merge 2 commits into
soxoj wants to merge 2 commits into
Conversation
GitHub now serves a new profile shell to authenticated viewers that broke three scraping paths in gitfive: - repos.py: the navigation tab counter moved from `<span class="Counter" title="N">` to `<span data-component="counter">` with the number nested in text. `gitfive user <name>` raised `ValueError: Could not find the repositories counter on the page.` Extract the count via a helper that handles both layouts. - utils.py: `get_commits_count` matched the commits link via `…/commits/<branch>$`, but the new shell renders it with a trailing slash. The Metamon post-push polling loop spun forever as a result. Allow an optional trailing slash and harden number extraction. - commits.py: the `/commits/<branch>` page no longer uses `li.js-commits-list-item` / `a.js-navigation-open` / `img.avatar-user`. Parse the embedded `<script type="application/json">` payload instead — `payload.commitGroups[].commits[]` gives the commit oid, the co-authored email, and the matched GitHub account (login + avatar) directly. Pull `currentCommit.oid` from the payload in place of the removed `permalink` anchor; pagination via `?after=<head>+<offset>` still works.
Contributor
Author
|
I will resolve conflicts later |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.