Skip to content

Command for retrieving dependents for a repo #34

Closed

Description

@simonw

I really, really want to start grabbing this data: https://github.com/simonw/datasette/network/dependents

Activity

  1. simonw commented on Apr 30, 2020

    @simonw
    CollaboratorAuthor

    Unfortunately it's not available through any GitHub API - I managed to figure out how to get dependencies, but I need dependents. https://github.com/simonw/til/blob/master/github/dependencies-graphql-api.md

  2. simonw commented on Apr 30, 2020

    @simonw
    CollaboratorAuthor

    It looks like the only option is to scrape them. I'll do that and then replace with an API as soon as one becomes available.

  3. changed the title [-]Command for accessing dependents or a repo[/-] [+]Command for accessing dependents for a repo[/+] on Apr 30, 2020
  4. simonw commented on Apr 30, 2020

    @simonw
    CollaboratorAuthor

    Proposed command:

    github-to-sqlite scrape-dependents github.db simonw/datasette
    

    I'll pull full details of the scraped repos from the regular API. I'll also record when they were "first seen" by the command.

  5. simonw commented on Apr 30, 2020

    @simonw
    CollaboratorAuthor

    I think this is the neatest scraping pattern:

    [a["href"].lstrip("/") for a in soup.select("a[data-hovercard-type=repository]")]
  6. simonw commented on Apr 30, 2020

    @simonw
    CollaboratorAuthor

    And to find the "Next" pagination link:

    soup.select(".paginate-container")[0].find("a", text="Next")
  7. changed the title [-]Command for accessing dependents for a repo[/-] [+]Command for retrieving dependents for a repo[/+] on Apr 30, 2020
  8. simonw commented on Apr 30, 2020

    @simonw
    CollaboratorAuthor
  9. added a commit that references this issue on Apr 30, 2020
  10. reopened this on May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions