Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PUT /user/starred/:owner/:repo
- import requests
- class Github:
- def __init__(self, token, api_url='https://api.github.com'):
- self.token = token
- self.api_url = api_url
- self.headers = {
- 'Accept': 'application/vnd.github.v3+json',
- 'Authorization': 'token ' + self.token
- }
- def star(self, repo, owner):
- requests.put(f"{self.api_url}/user/starred/{owner}/{repo}",
- headers=self.headers).raise_for_status()
- import os
- github = Github(os.environ['GITHUB_OAUTH_TOKEN'])
- github.star(repo='cpython', owner='python')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement