Debian Codegraph @

scrape/README.md

raw
1 [![GoDoc](https://godoc.org/github.com/google/go-github/scrape?status.svg)](https://godoc.org/github.com/google/go-github/scrape)
2
3 The scrape package provides an experimental client for accessing additional
4 GitHub data via screen scraping. It is designed to be a client of last resort
5 for data that cannot be retrieved via the REST or GraphQL APIs.
6
7 # What should be added here
8
9 **Add only what you need.** Whereas the main go-github library attempts to
10 implement the entire GitHub REST API, there is little point in trying to do that
11 here. Certainly, feel free to contribution patches to get data you actually
12 need, but I'd rather not try and provide exhaustive coverage of all GitHub data
13 here.
14
15 **Add only what can't be accessed elsewhere.** If the data can be retrieved
16 through the REST or GraphQL API, use the appropriate libraries for that.
17
18 **Prefer read-only access.** For now, I'm only focusing on reading data. It
19 might be that writing works fine as well, but it is of course much riskier.
20
21 # How to add methods
22
23 See [apps.go](apps.go) for examples of methods that access data. Basically,
24 fetch the contents of the page using `client.get`, and then use goquery to dig
25 into the markup on the page. Prefer selectors that grab semantic ID or class
26 names, as they are more likely to be stable.