Created
October 7, 2018 10:54
-
-
Save kojiisd/5a93e6a25c25ccde83702701899c9b35 to your computer and use it in GitHub Desktop.
GitLab APIを使ってIssuesの一覧を取得できるようにした ref: https://qiita.com/kojiisd/items/e5af8ef89592c4615c99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install -t libs requests | |
$ pip install -t libs beautifulsoup4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query = { | |
"scope": "all", | |
"state": status, | |
"milestone_title": os.environ['MILE_STONE'] , | |
"page": page | |
} | |
: | |
: | |
response = requests.get(os.environ['TARGET_URL'], headers=headers, params=query) | |
soup = BeautifulSoup(response.text, "html.parser") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Confirm ID for loop | |
if issue_num_list[0].text.replace("\n", "\t") == prev_num: | |
prev_curr_diff = False | |
prev_num = 0 | |
page = 1 | |
break | |
else: | |
prev_num = issue_num_list[0].text.replace("\n", "\t") | |
page += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for issue_num in issue_num_list: | |
issue_title = issue_title_list[index] | |
print(issue_num.text.replace("\n", "\t") + | |
status + "\t" + | |
issue_title.text.replace("\n", "\t") ) | |
index += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sls invoke local -f issues_manager |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment