Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read Democracy Lab #56

Open
giosce opened this issue Jun 5, 2021 · 1 comment
Open

Read Democracy Lab #56

giosce opened this issue Jun 5, 2021 · 1 comment

Comments

@giosce
Copy link
Collaborator

giosce commented Jun 5, 2021

DemocracyLab has provided an API to fetch projects that they host.
Mark Frischmuth told us is fine to call https://www.democracylab.org/api/projects every hour.

@themightychris
Copy link
Collaborator

themightychris commented Oct 25, 2021

Steps to implement this:

  1. Create a new "project repository" class here: https://github.com/codeforamerica/brigade-project-index/tree/master/crawler/lib/repositories/projects
    • It should extend the Projects abstract class like its peers File, GitHubTopic, and GitHubOrganization do
    • Each of these classes is ultimately a superclass of Map, and when loaded should be a map of ProjectId -> ProjectData where ProjectData is just an unstructured JSON data object
  2. Register that new repository here: https://github.com/codeforamerica/brigade-project-index/blob/master/crawler/lib/repositories/projects/index.js
    • This registration list is in priority order, the first class that returns true when its canLoadFromOrganization method is passed an entry from organizations.json is then in charge of loading a list of projects for that entry
  3. We'll want to PR a new entry for DemocracyLab into organizations.json and add the DemocracyLab projects repository class to the top position in the registry and hardcode it to just detect the democracylab entry and handle loading it. We can check that organization.projects_list_url == 'https://www.democracylab.org/api/projects'
  4. There are tests for each of these project repositories in here that (kind of unstably) check against some known data in the respective live APIs, add tests for this new class: https://github.com/codeforamerica/brigade-project-index/tree/master/crawler/lib/repositories/projects/__tests__

These docs cover how to test/debug changes like this locally: https://brigade.cloud/projects/crawler/contributing/crawler/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Prioritized Backlog
Development

No branches or pull requests

3 participants