codeforamerica/gotissues

Create a way to pull in total number of "closed" Github issues once per day.

Closed this issue · 0 comments

Description

Now that we have a way to look at all the clicked issues from Google Analytics, we want to see some stats about which issues have been closed, by whom, when, etc!

Example

The Github API's response for any issue looks like this. We want to specifically get and store the starred items and maybe other things if they seem to be useful for looking at what the properties of closed issues are!

Other info that will be useful

Moved to other issues

https://api.github.com/repos/codeforamerica/gotissues/issues/4

{
  *url*: "https://api.github.com/repos/codeforamerica/gotissues/issues/4",
  labels_url: "https://api.github.com/repos/codeforamerica/gotissues/issues/4/labels{/name}",
  comments_url: "https://api.github.com/repos/codeforamerica/gotissues/issues/4/comments",
  events_url: "https://api.github.com/repos/codeforamerica/gotissues/issues/4/events",
  html_url: "https://github.com/codeforamerica/gotissues/issues/4",
  id: 63817877,
  number: 4,
  *title*: "How to access Google Analytics as our server not a user?",
  user: {
    login: "ondrae",
    id: 595778,
    avatar_url: "https://avatars.githubusercontent.com/u/595778?v=3",
    gravatar_id: "",
    url: "https://api.github.com/users/ondrae",
    html_url: "https://github.com/ondrae",
    followers_url: "https://api.github.com/users/ondrae/followers",
    following_url: "https://api.github.com/users/ondrae/following{/other_user}",
    gists_url: "https://api.github.com/users/ondrae/gists{/gist_id}",
    starred_url: "https://api.github.com/users/ondrae/starred{/owner}{/repo}",
    subscriptions_url: "https://api.github.com/users/ondrae/subscriptions",
    organizations_url: "https://api.github.com/users/ondrae/orgs",
    repos_url: "https://api.github.com/users/ondrae/repos",
    events_url: "https://api.github.com/users/ondrae/events{/privacy}",
    received_events_url: "https://api.github.com/users/ondrae/received_events",
    type: "User",
    site_admin: false
  },
  *labels*: [
    {
      url: "https://api.github.com/repos/codeforamerica/gotissues/labels/question",
      name: "question",
      color: "cc317c"
    }
  ],
  *state*: "closed",
  locked: false,
  assignee: null,
  milestone: null,
  *comments*: 0,
  *created_at*: "2015-03-23T19:55:54Z",
  updated_at: "2015-06-10T00:20:31Z",
  *closed_at*: "2015-06-10T00:20:31Z",
  body: "Right now, I must first log in as my andrewh@codeforamerica.org account to get access to   Google Analytics data. How do we instead grant access for this service to talk to Google Analytics as itself. We want anyone who goes to that website to be able to see the data, not only me. ",
  *closed_by*: {
    *login*: "ondrae",
    id: 595778,
    avatar_url: "https://avatars.githubusercontent.com/u/595778?v=3",
    gravatar_id: "",
    url: "https://api.github.com/users/ondrae",
    html_url: "https://github.com/ondrae",
    followers_url: "https://api.github.com/users/ondrae/followers",
    following_url: "https://api.github.com/users/ondrae/following{/other_user}",
    gists_url: "https://api.github.com/users/ondrae/gists{/gist_id}",
    starred_url: "https://api.github.com/users/ondrae/starred{/owner}{/repo}",
    subscriptions_url: "https://api.github.com/users/ondrae/subscriptions",
    organizations_url: "https://api.github.com/users/ondrae/orgs",
    repos_url: "https://api.github.com/users/ondrae/repos",
    events_url: "https://api.github.com/users/ondrae/events{/privacy}",
    received_events_url: "https://api.github.com/users/ondrae/received_events",
    type: "User",
    site_admin: false
  }
}

Tasks

  • Write a very clear route that can take in one issue and write some type of result to a file
  • Expand the method to run the script with the issues
  • Create/test a JSON "dump" file to write response results to
  • Learn about writing this auto-update script with Heroku
  • Implement the script with the route
  • Test!

Files

run.py
New script to run by Heroku autoupdate