Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

use github credentials if available #2

Merged
merged 1 commit into from over 1 year ago

2 participants

Bernhard M. Wiedemann Ionuț Arțăriși
Bernhard M. Wiedemann

this is important to not hit the rate limit of 60/h
but have the higher 5000/h limit for authenticated users

Bernhard M. Wiedemann bmwiedemann use github credentials if available
this is important to not hit the rate limit of 60/h
but have the higher 5000/h limit for authenticated users
7a17908
Ionuț Arțăriși mapleoin merged commit a9992b9 into from
Ionuț Arțăriși mapleoin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 02, 2013
Bernhard M. Wiedemann bmwiedemann use github credentials if available
this is important to not hit the rate limit of 60/h
but have the higher 5000/h limit for authenticated users
7a17908
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. +10 1 github_tarballs
11 github_tarballs
@@ -25,8 +25,16 @@ import tarfile
25 25 import urllib
26 26
27 27
  28 +GITHUB_CREDS = ""
  29 +conffilebase = "github_tarballs_credentials"
  30 +try:
  31 + f = open(os.path.join(os.path.expanduser('~'), '.' + conffilebase))
  32 + GITHUB_CREDS = f.read().rstrip('\n') + '@'
  33 +except IOError:
  34 + pass
  35 +
28 36 COMMIT_HASH_SIZE = 7
29   -GITHUB_COMPARE = "https://api.github.com/repos/%(owner)s/%(repo)s/compare/%(base)s...%(head)s"
  37 +GITHUB_COMPARE = "https://%(creds)sapi.github.com/repos/%(owner)s/%(repo)s/compare/%(base)s...%(head)s"
30 38
31 39
32 40 def download_tarball(url, filename):
@@ -168,6 +176,7 @@ def get_changes(package, owner, repo, target):
168 176 current_commit = get_commit_from_spec(package)
169 177 url = GITHUB_COMPARE % dict(owner=owner,
170 178 repo=repo,
  179 + creds=GITHUB_CREDS,
171 180 base=current_commit or target,
172 181 head=target)
173 182 try:

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.