diff --git a/json/repos.json b/json/repos.json index b494c6d..2b06199 100644 --- a/json/repos.json +++ b/json/repos.json @@ -1,110 +1,110 @@ [ - { - "name": "vedic", - "url": "https://github.com/vedic-lang/vedic", - "description": "Vedic is World first working Programming launguage in Sanskrit", - "banner": "https://opengraph.githubassets.com/6385126dc7a56f8c675377650d4d11321dadee180480c28dd772497fbabdd856/vedic-lang/vedic", - "color": "#f1e05a", - "lang": "JavaScript", - "date": "2022-04-11T12:06:09Z", - "stars": 69, - "forks": 9, - "generatedOn": "2022-12-05 16:59:29.271252" - }, - { - "name": "bhagavad-gita-api", - "url": "https://github.com/vedicscriptures/bhagavad-gita-api", - "description": "An opensource rest API on Vedic Scripture Shrimad Bhagavad Gita", - "banner": "https://repository-images.githubusercontent.com/314205765/0bb18d80-2b22-11eb-8f6f-ccf20c0c2679", - "color": "#f1e05a", - "lang": "JavaScript", - "date": "2020-11-19T09:58:47Z", - "stars": 78, - "forks": 12, - "generatedOn": "2022-12-05 16:59:29.271252" - }, - { - "name": "IPL-2020-Prediction", - "url": "https://github.com/PtPrashantTripathi/IPL-2020-Prediction", - "description": "Predictive Analysis of an IPL Match using SVM Binary Classifier", - "banner": "https://repository-images.githubusercontent.com/299325888/77f6e880-034c-11eb-8ee1-b44403c583c2", - "color": "#e34c26", - "lang": "HTML", - "date": "2020-09-28T13:58:21Z", - "stars": 7, - "forks": 4, - "generatedOn": "2022-12-05 16:59:29.271252" - }, - { - "name": "linkpe", - "url": "https://github.com/PtPrashantTripathi/linkpe", - "description": "Linkpe is a Node.js based API\ud83d\udc33 to generate shareable UPI Payment links", - "banner": "https://repository-images.githubusercontent.com/302577255/baf4a800-0e84-11eb-9ccd-61f6eeec1ddb", - "color": "#e34c26", - "lang": "HTML", - "date": "2020-10-09T08:16:31Z", - "stars": 33, - "forks": 16, - "generatedOn": "2022-12-05 16:59:29.271252" - }, - { - "name": "movieinfo", - "url": "https://github.com/PtPrashantTripathi/movieinfo", - "description": "Movie info app built with OMDb API that gets movie info from IMDb and Rotten Tomatoes.", - "banner": "https://repository-images.githubusercontent.com/301684261/b94f3280-083b-11eb-84a9-dc749901f069", - "color": "#e34c26", - "lang": "HTML", - "date": "2020-10-06T10:02:13Z", - "stars": 8, - "forks": 3, - "generatedOn": "2022-12-05 16:59:29.271252" - }, - { - "name": "shreeganesh", - "url": "https://github.com/PtPrashantTripathi/shreeganesh", - "description": "This Astrology Android app provide solution of your life problem, based upon Krishna Jyotish Padathi.", - "banner": "https://repository-images.githubusercontent.com/176751084/75dfc580-1238-11eb-9ff5-7c3da715308e", - "color": "#b07219", - "lang": "Java", - "date": "2019-03-20T14:24:46Z", - "stars": 14, - "forks": 2, - "generatedOn": "2022-12-05 16:59:29.271252" - }, - { - "name": "cloud-storage-system", - "url": "https://github.com/PtPrashantTripathi/cloud-storage-system", - "description": "An Online Cloud Storage System, with functionality to add/upload/modify data on the real-time cloud.", - "banner": "https://opengraph.githubassets.com/003b70e7719a56fc2ea20cff90bc658b1d9bf1c18f5a3d790f5310c20d0c240f/PtPrashantTripathi/cloud-storage-system", - "color": "#b07219", - "lang": "Java", - "date": "2019-04-08T19:14:55Z", - "stars": 9, - "forks": 1, - "generatedOn": "2022-12-05 16:59:29.271252" - }, - { - "name": "Adhyatma", - "url": "https://github.com/PtPrashantTripathi/Adhyatma", - "description": "An Emotional State vedic scripture Quotes Serach Engain", - "banner": "https://opengraph.githubassets.com/5c0a216b2e4f94408194f88cc2f121fcc2d8c727ce1a84d8f1b635924aadbc71/PtPrashantTripathi/Adhyatma", - "color": "#4F5D95", - "lang": "PHP", - "date": "2019-03-12T18:04:10Z", - "stars": 9, - "forks": 1, - "generatedOn": "2022-12-05 16:59:29.271252" - }, - { - "name": "php-social-networking-site", - "url": "https://github.com/PtPrashantTripathi/php-social-networking-site", - "description": "A social Networking Site for student to show there project works and skills", - "banner": "https://opengraph.githubassets.com/8ca7093e812893d2dbcbdb914a2f3488870418c893e69f33333cc53262633f19/PtPrashantTripathi/php-social-networking-site", - "color": "#4F5D95", - "lang": "PHP", - "date": "2019-02-23T17:05:29Z", - "stars": 8, - "forks": 0, - "generatedOn": "2022-12-05 16:59:29.271252" - } -] + { + "name": "vedic", + "url": "https://github.com/vedic-lang/vedic", + "description": "Vedic is World first working Programming launguage in Sanskrit", + "banner": "https://opengraph.githubassets.com/67d5f3b161af396ee26bab6e139dfd72481b8108eb414956983714f360f426c2/vedic-lang/vedic", + "color": "#f1e05a", + "lang": "JavaScript", + "date": "2022-04-11T12:06:09Z", + "stars": 72, + "forks": 9, + "generatedOn": "2023-01-01 03:55:19.648618" + }, + { + "name": "bhagavad-gita-api", + "url": "https://github.com/vedicscriptures/bhagavad-gita-api", + "description": "An opensource rest API on Vedic Scripture Shrimad Bhagavad Gita", + "banner": "https://repository-images.githubusercontent.com/314205765/0bb18d80-2b22-11eb-8f6f-ccf20c0c2679", + "color": "#f1e05a", + "lang": "JavaScript", + "date": "2020-11-19T09:58:47Z", + "stars": 80, + "forks": 13, + "generatedOn": "2023-01-01 03:55:19.648618" + }, + { + "name": "IPL-2020-Prediction", + "url": "https://github.com/PtPrashantTripathi/IPL-2020-Prediction", + "description": "Predictive Analysis of an IPL Match using SVM Binary Classifier", + "banner": "https://repository-images.githubusercontent.com/299325888/77f6e880-034c-11eb-8ee1-b44403c583c2", + "color": "#e34c26", + "lang": "HTML", + "date": "2020-09-28T13:58:21Z", + "stars": 7, + "forks": 4, + "generatedOn": "2023-01-01 03:55:19.648618" + }, + { + "name": "linkpe", + "url": "https://github.com/PtPrashantTripathi/linkpe", + "description": "Linkpe is a Node.js based API\ud83d\udc33 to generate shareable UPI Payment links", + "banner": "https://repository-images.githubusercontent.com/302577255/baf4a800-0e84-11eb-9ccd-61f6eeec1ddb", + "color": "#e34c26", + "lang": "HTML", + "date": "2020-10-09T08:16:31Z", + "stars": 35, + "forks": 17, + "generatedOn": "2023-01-01 03:55:19.648618" + }, + { + "name": "movieinfo", + "url": "https://github.com/PtPrashantTripathi/movieinfo", + "description": "Movie info app built with OMDb API that gets movie info from IMDb and Rotten Tomatoes.", + "banner": "https://repository-images.githubusercontent.com/301684261/b94f3280-083b-11eb-84a9-dc749901f069", + "color": "#f1e05a", + "lang": "JavaScript", + "date": "2020-10-06T10:02:13Z", + "stars": 9, + "forks": 3, + "generatedOn": "2023-01-01 03:55:19.648618" + }, + { + "name": "shreeganesh", + "url": "https://github.com/PtPrashantTripathi/shreeganesh", + "description": "This Astrology Android app provide solution of your life problem, based upon Krishna Jyotish Padathi.", + "banner": "https://repository-images.githubusercontent.com/176751084/75dfc580-1238-11eb-9ff5-7c3da715308e", + "color": "#b07219", + "lang": "Java", + "date": "2019-03-20T14:24:46Z", + "stars": 14, + "forks": 2, + "generatedOn": "2023-01-01 03:55:19.648618" + }, + { + "name": "cloud-storage-system", + "url": "https://github.com/PtPrashantTripathi/cloud-storage-system", + "description": "An Online Cloud Storage System, with functionality to add/upload/modify data on the real-time cloud.", + "banner": "https://opengraph.githubassets.com/003b70e7719a56fc2ea20cff90bc658b1d9bf1c18f5a3d790f5310c20d0c240f/PtPrashantTripathi/cloud-storage-system", + "color": "#b07219", + "lang": "Java", + "date": "2019-04-08T19:14:55Z", + "stars": 9, + "forks": 1, + "generatedOn": "2023-01-01 03:55:19.648618" + }, + { + "name": "Adhyatma", + "url": "https://github.com/PtPrashantTripathi/Adhyatma", + "description": "An Emotional State vedic scripture Quotes Serach Engain", + "banner": "https://opengraph.githubassets.com/5c0a216b2e4f94408194f88cc2f121fcc2d8c727ce1a84d8f1b635924aadbc71/PtPrashantTripathi/Adhyatma", + "color": "#4F5D95", + "lang": "PHP", + "date": "2019-03-12T18:04:10Z", + "stars": 9, + "forks": 1, + "generatedOn": "2023-01-01 03:55:19.648618" + }, + { + "name": "php-social-networking-site", + "url": "https://github.com/PtPrashantTripathi/php-social-networking-site", + "description": "A social Networking Site for student to show there project works and skills", + "banner": "https://opengraph.githubassets.com/8ca7093e812893d2dbcbdb914a2f3488870418c893e69f33333cc53262633f19/PtPrashantTripathi/php-social-networking-site", + "color": "#4F5D95", + "lang": "PHP", + "date": "2019-02-23T17:05:29Z", + "stars": 8, + "forks": 0, + "generatedOn": "2023-01-01 03:55:19.648618" + } +] \ No newline at end of file diff --git a/main.py b/main.py index ff8b721..1764fd2 100644 --- a/main.py +++ b/main.py @@ -6,69 +6,72 @@ # datetime object containing current date and time now = str(datetime.now()) - + print("now =", now) + # Parsing data from api def getjson(url): response = requests.get(url) return json.loads(response.text) -# Parsing metadata from url + +# Parsing metadata from url def getBanner(url): response = requests.get(url) - soup = BeautifulSoup(response.text,'html.parser') - metas = soup.find_all('meta') #Get Meta og:image + soup = BeautifulSoup(response.text, 'html.parser') + metas = soup.find_all('meta') #Get Meta og:image for m in metas: - if m.get ('property') == 'og:image': + if m.get('property') == 'og:image': banner = m.get('content') return banner + # color name to css color code list -colors = getjson('https://raw.githubusercontent.com/ozh/github-colors/master/colors.json') +colors = getjson( + 'https://raw.githubusercontent.com/ozh/github-colors/master/colors.json') # all the repos list which i want to show on website -repos_list= [ - "vedic-lang/vedic", - "vedicscriptures/bhagavad-gita-api", - "PtPrashantTripathi/IPL-2020-Prediction", - "PtPrashantTripathi/linkpe", - "PtPrashantTripathi/movieinfo", - "PtPrashantTripathi/Shree-Ganesh", - "PtPrashantTripathi/Cloud-Storage-System", - "PtPrashantTripathi/Adhyatma", - "PtPrashantTripathi/php-social-networking-site"] +repos_list = [ + "vedic-lang/vedic", "vedicscriptures/bhagavad-gita-api", + "PtPrashantTripathi/IPL-2020-Prediction", "PtPrashantTripathi/linkpe", + "PtPrashantTripathi/movieinfo", "PtPrashantTripathi/Shree-Ganesh", + "PtPrashantTripathi/Cloud-Storage-System", "PtPrashantTripathi/Adhyatma", + "PtPrashantTripathi/php-social-networking-site" +] # execuation timer start_time = time.time() -# empty list variable for repo variable -repos_data=[] +# empty list variable for repo variable +repos_data = [] # main fuction for repo in repos_list: rdata = getjson(f'https://api.github.com/repos/{repo}') banner = getBanner(f'https://github.com/{repo}') - data ={ - "name":rdata["name"], - "url":rdata["html_url"], - "description":rdata["description"], - "banner":banner, - "color":colors[rdata["language"]]["color"] if rdata["language"] else '', - "lang":rdata["language"], - "date":rdata["created_at"], - "stars":rdata["stargazers_count"], - "forks":rdata["forks"], - "generatedOn":now - } + data = { + "name": rdata["name"], + "url": rdata["html_url"], + "description": rdata["description"], + "banner": banner, + "color": + colors[rdata["language"]]["color"] if rdata["language"] else '', + "lang": rdata["language"], + "date": rdata["created_at"], + "stars": rdata["stargazers_count"], + "forks": rdata["forks"], + "generatedOn": now + } repos_data.append(data) print(f"{repo} done\t--- {time.time() - start_time} seconds ---") -# Serializing json -json_data = json.dumps(repos_data, indent = 4) - + +# Serializing json +json_data = json.dumps(repos_data, indent=4) + # Writing to repos.json with open("json/repos.json", "w") as outfile: outfile.write(json_data) # Total execuation time -print(f"all done\t--- {time.time() - start_time} seconds ---") +print(f"all done\t--- {time.time() - start_time} seconds ---") \ No newline at end of file