程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python爬取gitee提交日歷API實現

編輯:Python

作為一個寫代碼的,必然會用到代碼托管,比如大家熟知的GitHub,還有國內比較常用的gitee。我個人更喜歡用GitHub,因為他更加的輕松與高級。gitee的話,一般團隊項目會用到,因為不用科學上網,用起來要方便很多,也快很多。
於是就產生了一個很不好的現象:gitee和GitHub都綠的很分散,而且兩者還幾乎互補。
對於一個強迫症患者,這樣的現象真的是無!法!接!受!
於是我萌生出一種想法,自己做一個提交日歷,將gitee和GitHub的提交日歷合並成一個,這樣看起來多美麗多有成就感呀。但是我在GitHub和gitee上都沒有找到很合適的開源項目,於是決定自己eng造一個。那麼首先第一步是要獲取gitee和GitHub的提交日歷的數據。獲取GitHub的日歷的項目在GitHub上有現成的,而爬取gitee的卻沒有。
於是乎,我就自己寫了一個
具體內容大家可以看我的GitHub上的項目:https://github.com/charlesix59/gitee-calendar
它將返回一個獲取你所有提交的json字符串,以方便前端解析
以下是一個demo:

[{
"date": "2021-06-25", "count": 0}, {
"date": "2021-06-26", "count": 0}, {
"date": "2021-06-27", "count": 0}, {
"date": "2021-06-28", "count": 0}, {
"date": "2021-06-29", "count": 0}, {
"date": "2021-06-30", "count": 0}, {
"date": "2021-07-01", "count": 0}, {
"date": "2021-07-02", "count": 0}, {
"date": "2021-07-03", "count": 0}, {
"date": "2021-07-04", "count": 0}, {
"date": "2021-07-05", "count": 0}, {
"date": "2021-07-06", "count": 0}, {
"date": "2021-07-07", "count": 0}, {
"date": "2021-07-08", "count": 0}, {
"date": "2021-07-09", "count": 0}, {
"date": "2021-07-10", "count": 0}, {
"date": "2021-07-11", "count": 0}, {
"date": "2021-07-12", "count": 0}, {
"date": "2021-07-13", "count": 0}, {
"date": "2021-07-14", "count": 0}, {
"date": "2021-07-15", "count": 0}, {
"date": "2021-07-16", "count": 0}, {
"date": "2021-07-17", "count": 0}, {
"date": "2021-07-18", "count": 0}, {
"date": "2021-07-19", "count": 0}, {
"date": "2021-07-20", "count": 0}, {
"date": "2021-07-21", "count": 0}, {
"date": "2021-07-22", "count": 0}, {
"date": "2021-07-23", "count": 0}, {
"date": "2021-07-24", "count": 0}, {
"date": "2021-07-25", "count": 0}, {
"date": "2021-07-26", "count": 0}, {
"date": "2021-07-27", "count": 0}, {
"date": "2021-07-28", "count": 0}, {
"date": "2021-07-29", "count": 0}, {
"date": "2021-07-30", "count": 0}, {
"date": "2021-07-31", "count": 0}, {
"date": "2021-08-01", "count": 0}, {
"date": "2021-08-02", "count": 0}, {
"date": "2021-08-03", "count": 0}, {
"date": "2021-08-04", "count": 0}, {
"date": "2021-08-05", "count": 0}, {
"date": "2021-08-06", "count": 0}, {
"date": "2021-08-07", "count": 0}, {
"date": "2021-08-08", "count": 0}, {
"date": "2021-08-09", "count": 0}, {
"date": "2021-08-10", "count": 0}, {
"date": "2021-08-11", "count": 0}, {
"date": "2021-08-12", "count": 0}, {
"date": "2021-08-13", "count": 0}, {
"date": "2021-08-14", "count": 0}, {
"date": "2021-08-15", "count": 0}, {
"date": "2021-08-16", "count": 0}, {
"date": "2021-08-17", "count": 0}, {
"date": "2021-08-18", "count": 0}, {
"date": "2021-08-19", "count": 0}, {
"date": "2021-08-20", "count": 0}, {
"date": "2021-08-21", "count": 0}, {
"date": "2021-08-22", "count": 0}, {
"date": "2021-08-23", "count": 0}, {
"date": "2021-08-24", "count": 0}, {
"date": "2021-08-25", "count": 0}, {
"date": "2021-08-26", "count": 0}, {
"date": "2021-08-27", "count": 0}, {
"date": "2021-08-28", "count": 0}, {
"date": "2021-08-29", "count": 0}, {
"date": "2021-08-30", "count": 0}, {
"date": "2021-08-31", "count": 0}, {
"date": "2021-09-01", "count": 0}, {
"date": "2021-09-02", "count": 0}, {
"date": "2021-09-03", "count": 0}, {
"date": "2021-09-04", "count": 0}, {
"date": "2021-09-05", "count": 0}, {
"date": "2021-09-06", "count": 0}, {
"date": "2021-09-07", "count": 0}, {
"date": "2021-09-08", "count": 0}, {
"date": "2021-09-09", "count": 0}, {
"date": "2021-09-10", "count": 0}, {
"date": "2021-09-11", "count": 0}, {
"date": "2021-09-12", "count": 0}, {
"date": "2021-09-13", "count": 0}, {
"date": "2021-09-14", "count": 0}, {
"date": "2021-09-15", "count": 0}, {
"date": "2021-09-16", "count": 0}, {
"date": "2021-09-17", "count": 0}, {
"date": "2021-09-18", "count": 0}, {
"date": "2021-09-19", "count": 0}, {
"date": "2021-09-20", "count": 0}, {
"date": "2021-09-21", "count": 0}, {
"date": "2021-09-22", "count": 0}, {
"date": "2021-09-23", "count": 0}, {
"date": "2021-09-24", "count": 0}, {
"date": "2021-09-25", "count": 0}, {
"date": "2021-09-26", "count": 0}, {
"date": "2021-09-27", "count": 0}, {
"date": "2021-09-28", "count": 0}, {
"date": "2021-09-29", "count": 0}, {
"date": "2021-09-30", "count": 0}, {
"date": "2021-10-01", "count": 0}, {
"date": "2021-10-02", "count": 0}, {
"date": "2021-10-03", "count": 0}, {
"date": "2021-10-04", "count": 0}, {
"date": "2021-10-05", "count": 0}, {
"date": "2021-10-06", "count": 0}, {
"date": "2021-10-07", "count": 0}, {
"date": "2021-10-08", "count": 0}, {
"date": "2021-10-09", "count": 0}, {
"date": "2021-10-10", "count": 0}, {
"date": "2021-10-11", "count": 0}, {
"date": "2021-10-12", "count": 0}, {
"date": "2021-10-13", "count": 0}, {
"date": "2021-10-14", "count": 0}, {
"date": "2021-10-15", "count": 0}, {
"date": "2021-10-16", "count": 0}, {
"date": "2021-10-17", "count": 0}, {
"date": "2021-10-18", "count": 0}, {
"date": "2021-10-19", "count": 0}, {
"date": "2021-10-20", "count": 0}, {
"date": "2021-10-21", "count": 0}, {
"date": "2021-10-22", "count": 0}, {
"date": "2021-10-23", "count": 0}, {
"date": "2021-10-24", "count": 0}, {
"date": "2021-10-25", "count": 0}, {
"date": "2021-10-26", "count": 0}, {
"date": "2021-10-27", "count": 0}, {
"date": "2021-10-28", "count": 0}, {
"date": "2021-10-29", "count": 0}, {
"date": "2021-10-30", "count": 0}, {
"date": "2021-11-02", "count": 0}, {
"date": "2021-11-03", "count": 0}, {
"date": "2021-11-05", "count": 0}, {
"date": "2021-11-06", "count": 0}, {
"date": "2021-11-07", "count": 0}, {
"date": "2021-11-08", "count": 0}, {
"date": "2021-11-09", "count": 0}, {
"date": "2021-11-10", "count": 0}, {
"date": "2021-11-12", "count": 0}, {
"date": "2021-11-25", "count": 0}, {
"date": "2021-12-01", "count": 0}, {
"date": "2021-12-03", "count": 0}, {
"date": "2021-12-04", "count": 0}, {
"date": "2021-12-08", "count": 0}, {
"date": "2021-12-17", "count": 0}, {
"date": "2021-12-18", "count": 0}, {
"date": "2021-12-19", "count": 0}, {
"date": "2021-12-20", "count": 0}, {
"date": "2021-12-23", "count": 0}, {
"date": "2021-12-24", "count": 0}, {
"date": "2021-12-25", "count": 0}, {
"date": "2021-12-27", "count": 0}, {
"date": "2021-12-28", "count": 0}, {
"date": "2021-12-29", "count": 0}, {
"date": "2021-12-30", "count": 0}, {
"date": "2021-12-31", "count": 0}, {
"date": "2022-01-01", "count": 0}, {
"date": "2022-01-02", "count": 0}, {
"date": "2022-01-03", "count": 0}, {
"date": "2022-01-04", "count": 0}, {
"date": "2022-01-06", "count": 0}, {
"date": "2022-01-07", "count": 0}, {
"date": "2022-01-08", "count": 0}, {
"date": "2022-01-09", "count": 0}, {
"date": "2022-01-10", "count": 0}, {
"date": "2022-01-11", "count": 0}, {
"date": "2022-01-12", "count": 0}, {
"date": "2022-01-13", "count": 0}, {
"date": "2022-01-14", "count": 0}, {
"date": "2022-01-15", "count": 0}, {
"date": "2022-01-16", "count": 0}, {
"date": "2022-01-17", "count": 0}, {
"date": "2022-01-18", "count": 0}, {
"date": "2022-01-19", "count": 0}, {
"date": "2022-01-20", "count": 0}, {
"date": "2022-01-21", "count": 0}, {
"date": "2022-01-22", "count": 0}, {
"date": "2022-01-23", "count": 0}, {
"date": "2022-01-24", "count": 0}, {
"date": "2022-01-25", "count": 0}, {
"date": "2022-01-26", "count": 0}, {
"date": "2022-01-27", "count": 0}, {
"date": "2022-01-28", "count": 0}, {
"date": "2022-01-29", "count": 0}, {
"date": "2022-01-30", "count": 0}, {
"date": "2022-01-31", "count": 0}, {
"date": "2022-02-01", "count": 0}, {
"date": "2022-02-02", "count": 0}, {
"date": "2022-02-03", "count": 0}, {
"date": "2022-02-04", "count": 0}, {
"date": "2022-02-05", "count": 0}, {
"date": "2022-02-06", "count": 0}, {
"date": "2022-02-07", "count": 0}, {
"date": "2022-02-08", "count": 0}, {
"date": "2022-02-09", "count": 0}, {
"date": "2022-02-10", "count": 0}, {
"date": "2022-02-11", "count": 0}, {
"date": "2022-02-12", "count": 0}, {
"date": "2022-02-13", "count": 0}, {
"date": "2022-02-14", "count": 0}, {
"date": "2022-02-15", "count": 0}, {
"date": "2022-02-16", "count": 0}, {
"date": "2022-02-17", "count": 0}, {
"date": "2022-02-18", "count": 0}, {
"date": "2022-02-19", "count": 0}, {
"date": "2022-02-20", "count": 0}, {
"date": "2022-02-21", "count": 0}, {
"date": "2022-02-22", "count": 0}, {
"date": "2022-02-23", "count": 0}, {
"date": "2022-02-24", "count": 0}, {
"date": "2022-02-25", "count": 0}, {
"date": "2022-02-26", "count": 0}, {
"date": "2022-02-27", "count": 0}, {
"date": "2022-02-28", "count": 0}, {
"date": "2022-03-01", "count": 0}, {
"date": "2022-03-02", "count": 0}, {
"date": "2022-03-03", "count": 0}, {
"date": "2022-03-04", "count": 0}, {
"date": "2022-03-05", "count": 0}, {
"date": "2022-03-06", "count": 0}, {
"date": "2022-03-07", "count": 0}, {
"date": "2022-03-08", "count": 0}, {
"date": "2022-03-09", "count": 0}, {
"date": "2022-03-10", "count": 0}, {
"date": "2022-03-11", "count": 0}, {
"date": "2022-03-12", "count": 0}, {
"date": "2022-03-13", "count": 0}, {
"date": "2022-03-14", "count": 0}, {
"date": "2022-03-15", "count": 0}, {
"date": "2022-03-16", "count": 0}, {
"date": "2022-03-17", "count": 0}, {
"date": "2022-03-27", "count": 0}, {
"date": "2022-04-01", "count": 0}, {
"date": "2022-04-02", "count": 0}, {
"date": "2022-04-09", "count": 0}, {
"date": "2022-04-10", "count": 0}, {
"date": "2022-04-11", "count": 0}, {
"date": "2022-04-12", "count": 0}, {
"date": "2022-04-17", "count": 0}, {
"date": "2022-04-19", "count": 0}, {
"date": "2022-04-26", "count": 0}, {
"date": "2022-04-29", "count": 0}, {
"date": "2022-05-03", "count": 0}, {
"date": "2022-05-04", "count": 0}, {
"date": "2022-05-12", "count": 0}, {
"date": "2022-05-13", "count": 0}, {
"date": "2022-05-16", "count": 0}, {
"date": "2022-05-17", "count": 0}, {
"date": "2022-05-25", "count": 0}, {
"date": "2022-05-28", "count": 0}, {
"date": "2022-05-29", "count": 0}, {
"date": "2022-06-01", "count": 0}, {
"date": "2022-06-04", "count": 0}, {
"date": "2022-06-05", "count": 0}, {
"date": "2022-06-06", "count": 0}, {
"date": "2022-06-07", "count": 0}, {
"date": "2022-06-08", "count": 0}, {
"date": "2022-06-09", "count": 0}, {
"date": "2022-06-10", "count": 0}, {
"date": "2022-06-11", "count": 0}, {
"date": "2022-06-12", "count": 0}, {
"date": "2022-06-13", "count": 0}, {
"date": "2022-06-14", "count": 0}, {
"date": "2022-06-15", "count": 0}, {
"date": "2022-06-16", "count": 0}, {
"date": "2022-06-17", "count": 0}, {
"date": "2022-06-18", "count": 0}, {
"date": "2022-06-19", "count": 0}, {
"date": "2022-06-20", "count": 0}, {
"date": "2022-06-21", "count": 0}, {
"date": "2022-06-22", "count": 0}, {
"date": "2022-06-23", "count": 0}, {
"date": "2022-06-24", "count": 0}, {
"date": "2022-06-25", "count": 0}, {
"date": "2021-10-31", "count": 1}, {
"date": "2021-11-01", "count": 1}, {
"date": "2021-11-04", "count": 1}, {
"date": "2021-11-11", "count": 1}, {
"date": "2021-11-13", "count": 4}, {
"date": "2021-11-14", "count": 2}, {
"date": "2021-11-15", "count": 1}, {
"date": "2021-11-16", "count": 2}, {
"date": "2021-11-17", "count": 4}, {
"date": "2021-11-18", "count": 3}, {
"date": "2021-11-19", "count": 2}, {
"date": "2021-11-20", "count": 3}, {
"date": "2021-11-21", "count": 1}, {
"date": "2021-11-22", "count": 1}, {
"date": "2021-11-23", "count": 1}, {
"date": "2021-11-24", "count": 1}, {
"date": "2021-11-26", "count": 3}, {
"date": "2021-11-27", "count": 3}, {
"date": "2021-11-28", "count": 4}, {
"date": "2021-11-29", "count": 1}, {
"date": "2021-11-30", "count": 2}, {
"date": "2021-12-02", "count": 1}, {
"date": "2021-12-05", "count": 3}, {
"date": "2021-12-06", "count": 3}, {
"date": "2021-12-07", "count": 4}, {
"date": "2021-12-09", "count": 3}, {
"date": "2021-12-10", "count": 3}, {
"date": "2021-12-11", "count": 2}, {
"date": "2021-12-12", "count": 1}, {
"date": "2021-12-13", "count": 3}, {
"date": "2021-12-14", "count": 5}, {
"date": "2021-12-15", "count": 3}, {
"date": "2021-12-16", "count": 2}, {
"date": "2021-12-21", "count": 2}, {
"date": "2021-12-22", "count": 1}, {
"date": "2021-12-26", "count": 2}, {
"date": "2022-01-05", "count": 1}, {
"date": "2022-03-18", "count": 5}, {
"date": "2022-03-19", "count": 4}, {
"date": "2022-03-20", "count": 2}, {
"date": "2022-03-21", "count": 2}, {
"date": "2022-03-22", "count": 2}, {
"date": "2022-03-23", "count": 3}, {
"date": "2022-03-24", "count": 3}, {
"date": "2022-03-25", "count": 4}, {
"date": "2022-03-26", "count": 1}, {
"date": "2022-03-28", "count": 5}, {
"date": "2022-03-29", "count": 2}, {
"date": "2022-03-30", "count": 2}, {
"date": "2022-03-31", "count": 6}, {
"date": "2022-04-03", "count": 5}, {
"date": "2022-04-04", "count": 5}, {
"date": "2022-04-05", "count": 1}, {
"date": "2022-04-06", "count": 1}, {
"date": "2022-04-07", "count": 3}, {
"date": "2022-04-08", "count": 2}, {
"date": "2022-04-13", "count": 2}, {
"date": "2022-04-14", "count": 2}, {
"date": "2022-04-15", "count": 2}, {
"date": "2022-04-16", "count": 2}, {
"date": "2022-04-18", "count": 1}, {
"date": "2022-04-20", "count": 5}, {
"date": "2022-04-21", "count": 1}, {
"date": "2022-04-22", "count": 3}, {
"date": "2022-04-23", "count": 2}, {
"date": "2022-04-24", "count": 2}, {
"date": "2022-04-25", "count": 4}, {
"date": "2022-04-27", "count": 3}, {
"date": "2022-04-28", "count": 2}, {
"date": "2022-04-30", "count": 1}, {
"date": "2022-05-01", "count": 1}, {
"date": "2022-05-02", "count": 3}, {
"date": "2022-05-05", "count": 1}, {
"date": "2022-05-06", "count": 1}, {
"date": "2022-05-07", "count": 1}, {
"date": "2022-05-08", "count": 1}, {
"date": "2022-05-09", "count": 1}, {
"date": "2022-05-10", "count": 1}, {
"date": "2022-05-11", "count": 1}, {
"date": "2022-05-14", "count": 1}, {
"date": "2022-05-15", "count": 1}, {
"date": "2022-05-18", "count": 1}, {
"date": "2022-05-19", "count": 1}, {
"date": "2022-05-20", "count": 1}, {
"date": "2022-05-21", "count": 2}, {
"date": "2022-05-22", "count": 1}, {
"date": "2022-05-23", "count": 1}, {
"date": "2022-05-24", "count": 1}, {
"date": "2022-05-26", "count": 1}, {
"date": "2022-05-27", "count": 1}, {
"date": "2022-05-30", "count": 1}, {
"date": "2022-05-31", "count": 1}, {
"date": "2022-06-02", "count": 1}, {
"date": "2022-06-03", "count": 1}]

當然,這只是我完成提交日歷的第一步,以後會慢慢拿出這個問題的完整解決方案的,雖然不知道具體要多久就是了


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved