-
Notifications
You must be signed in to change notification settings - Fork 0
/
github_profile_viewer.py
440 lines (427 loc) · 23.4 KB
/
github_profile_viewer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
import json
import requests
import tkinter as tk
from tkinter import messagebox
from threading import Thread
from PIL import Image,ImageTk
import io
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,NavigationToolbar2Tk)
import webbrowser
# Function to open the selected data from listbox 'listbox1' in github website in default web browser.
def get_listbox1_selected(event):
selected_content = listbox1.curselection()[0]
answer = listbox1.get(selected_content)
webbrowser.open_new_tab(f"https://www.github.com/{current_username}/{answer}")
# Function to open the selected data from listbox 'listbox2' in github website in default web browser.
def get_listbox2_selected(event):
answer = listbox2.get(listbox2.curselection()[0])
webbrowser.open_new_tab(f"https://www.github.com/{current_username}/{answer}")
# Function to open an url in default web browser.
def open_user_profile_in_browser(event):
webbrowser.open(f"https://www.github.com/{current_username}")
def plot_stars_top_starred_repos(arr1,labels_arr):
for widget in frame5.winfo_children():
widget.destroy()
fig = Figure(figsize=(3.5, 3),dpi=80)
# adding the subplot
plot1 = fig.add_subplot(111)
numpyarr = np.array(arr1)
# plotting the graph
for ptr in range(len(labels_arr)):
labels_arr[ptr] = str(labels_arr[ptr][0:3]) +" ("+str(arr1[ptr])+")"
if max(arr1)==0:
plot1.bar(labels_arr,numpyarr)
else:
plot1.bar(labels_arr,numpyarr,color="purple",width=0.2)
tk.Label(frame5,text="Stars of Top Starred Repos",font=("Times New Roman",14,"bold"),image=star_icon,compound=tk.LEFT,bg=ui_background_color_primary).pack()
# creating the Tkinter canvas
# containing the Matplotlib figure
canvas = FigureCanvasTkAgg(fig,master=frame5)
canvas.draw()
# placing the canvas on the Tkinter window
canvas.get_tk_widget().pack()
# Function to display all the programming languages used in the given username as a pie chart.
def plot_languages_used(arr1,labels_arr):
for widget in frame6.winfo_children():
widget.destroy()
fig = Figure(figsize=(3.5,3),dpi=90)
# adding the subplot
plot1 = fig.add_subplot(111)
numpyarr = np.array(arr1)
for ptr in range(len(labels_arr)):
labels_arr[ptr] += " ("+str(arr1[ptr])+")"
# plotting the graph
plot1.pie(numpyarr,labels=labels_arr)
tk.Label(frame6,text="Languages in Repositories",font=("Times New Roman",14,"bold"),image=languages_icon,compound=tk.LEFT,bg=ui_background_color_primary).pack()
# creating the Tkinter canvas
# containing the Matplotlib figure
canvas = FigureCanvasTkAgg(fig,master=frame6)
canvas.draw()
# placing the canvas on the Tkinter window
canvas.get_tk_widget().pack()
def plot_commits(arr1,labels_arr):
for widget in frame_commits.winfo_children():
widget.destroy()
fig = Figure(figsize=(4.5,3),dpi=90)
# adding the subplot
plot1 = fig.add_subplot(111)
numpyarr = np.array(arr1)
for ptr in range(len(labels_arr)):
labels_arr[ptr] += " ("+str(arr1[ptr])+")"
# plotting the graph
plot1.pie(numpyarr,labels=labels_arr)
tk.Label(frame_commits,text="Most Commits",font=("Times New Roman",14,"bold"),image=commit_icon,compound=tk.LEFT,bg=ui_background_color_primary).pack()
# creating the Tkinter canvas containing the Matplotlib figure
canvas = FigureCanvasTkAgg(fig,master=frame_commits)
canvas.draw()
# placing the canvas on the Tkinter window
canvas.get_tk_widget().pack()
# Function to display bar chart.
def plot_bar_chart(arr1,labels_arr):
for widget in frame7.winfo_children():
widget.destroy()
fig = Figure(figsize=(5.5, 3),dpi=80)
# adding the subplot
plot1 = fig.add_subplot(111)
numpyarr = np.array(arr1)
# plotting the graph
plot1.bar(labels_arr,arr1)
tk.Label(frame7,text="Repositories created over years",font=("Times New Roman",14,"bold"),image=repositories_icon,compound=tk.LEFT,bg=ui_background_color_primary).pack()
# creating the Tkinter canvas
# containing the Matplotlib figure
canvas = FigureCanvasTkAgg(fig,master=frame7)
canvas.draw()
# placing the canvas on the Tkinter window
canvas.get_tk_widget().pack()
def sort_by_values(myDic):
dict1 = {}
for reponame in myDic:
stars = myDic[reponame]
if stars not in dict1:
dict1.update({stars:[reponame]})
else:
arr = dict1.get(stars)
arr.append(reponame)
dict1.update({stars:arr})
keys_list = list(dict1.keys())
keys_list.sort(reverse=True)
ans = {i:dict1[i] for i in keys_list}
total_five_starred_repos = []
top_five_repo_stars_list = []
for num in ans:
if len(total_five_starred_repos)<5:
subarr = [num]*len(ans.get(num))
top_five_repo_stars_list.extend(subarr)
total_five_starred_repos.extend(ans.get(num))
else:
break
return (top_five_repo_stars_list,total_five_starred_repos)
# Function to display the avatar of the given username fetched from Github profile.
def load_image(avatarurl):
user_profilepic = avatarurl
# Requesting to API
response_profilepic = requests.get(user_profilepic)
if response_profilepic.status_code == 200:
imageobject = Image.open(io.BytesIO(response_profilepic.content))
imageobject = imageobject.resize((100, 100))
photovar = ImageTk.PhotoImage(imageobject)
pp_label.config(image=photovar)
pp_label.image = photovar
else:
messagebox.showerror("Rate limit exceeded","Try again after 1 hour")
# Function to display the number of most committed repositories of the current username.
def get_commit_details(current_commit_url,headers_input):
# Requesting to API
response = requests.get(current_commit_url,headers=headers_input)
if response.status_code==200:
obj2 = json.loads(response.content)
return len(obj2)
else:
messagebox.showerror("Rate limit exceeded", "Try again after 1 hour")
# Function to get all data of github user if the profile exists.
def get_user_details():
global current_username
search_button.config(state=tk.DISABLED)
username = username_var.get().lower()
# Hide the widgets displaying previously in the frames.
for widget in frame5.winfo_children():
widget.destroy()
for widget in frame6.winfo_children():
widget.destroy()
for widget in frame7.winfo_children():
widget.destroy()
for widget in frame_commits.winfo_children():
widget.destroy()
listbox1.delete(0,tk.END)
listbox2.delete(0,tk.END)
listbox3.delete(0,tk.END)
listbox4.delete(0,tk.END)
# Requesting to GitHub API.
custom_url = 'https://api.github.com/users/'+username
headers = {'Authorization': 'YOUR_GITHUB_TOKEN'} # Replace with your Github personal access token
response = requests.get(custom_url,headers=headers)
# If request is success.
if response.status_code==200:
current_username = username
obj = json.loads(response.content)
# Display user avatar picture
load_image(obj["avatar_url"])
label_name.config(text=str(obj["name"])[0:34])
label_username.config(text="@"+str(obj["login"]))
label_user_url.config(text=obj["html_url"],fg="blue")
if obj["company"]==None:
label_user_company.config(text="")
else:
label_user_company.config(text=obj["company"])
if obj["email"]==None:
label_email.config(text="")
else:
label_email.config(text=obj["email"])
if obj["location"]==None:
label_user_location.config(text="")
else:
label_user_location.config(text=obj["location"])
if obj["twitter_username"]==None:
label_twitter.config(text="")
else:
label_twitter.config(text=obj["twitter_username"])
label_followers_count.config(text=str(obj["followers"]))
label_following_count.config(text=obj["following"])
if obj["bio"]==None:
label_bio.config(text="")
else:
label_bio.config(text=str(obj["bio"])[0:40])
label_total_repositories_count.config(text=obj["public_repos"])
label_acct_created.config(text=str(obj["created_at"])[:10])
label_acct_last_modified.config(text=str(obj["updated_at"])[:10])
# Get all repository names.
# Parsing the url to get JSON data about repos of current username.
repo_names_response = json.loads(requests.get(obj["repos_url"],headers=headers).content)
# Delete all previously available elements from the listbox 'listbox1'.
listbox1.delete(0,tk.END)
# Display repository names of current user in listbox
repo_names_arr = []
starscount_arr = []
reponame_starscount_dict = {}
language_name_count_dict = {}
year_repo_count = {}
reponame_commits_count_dict = {}
# Iterating through every repository names in 'repo_names_response'.
for current_repo_name in repo_names_response:
commits_details = current_repo_name["commits_url"]
url_to_send = commits_details[:len(commits_details)-6]
total_number_of_commits = get_commit_details(url_to_send,headers)
reponame_commits_count_dict.update({current_repo_name["name"]:total_number_of_commits})
year_created = str(current_repo_name["created_at"])[:4]
year_created = int(year_created)
if year_created not in year_repo_count:
year_repo_count.update({year_created:1})
else:
year_repo_count.update({year_created:year_repo_count.get(year_created)+1})
plot_bar_chart(list(year_repo_count.values()),list(year_repo_count.keys()))
repo_names_arr.append(current_repo_name["name"])
stars_count = current_repo_name["stargazers_count"]
starscount_arr.append(stars_count)
reponame_starscount_dict.update({current_repo_name["name"]:stars_count})
current_lang = current_repo_name["language"]
if current_lang!=None:
if current_lang not in language_name_count_dict:
language_name_count_dict.update({current_lang:1})
else:
language_name_count_dict.update({current_lang:language_name_count_dict.get(current_lang)+1})
listbox1.insert(tk.END,str(current_repo_name["name"]))
answer = sort_by_values(reponame_starscount_dict)
top_five_repos = answer[1]
# Delete all previous data present in the listbox 'listbox2'.
listbox2.delete(0,tk.END)
for current_repo_name in top_five_repos:
listbox2.insert(tk.END,current_repo_name)
plot_stars_top_starred_repos(answer[0], answer[1])
top_five_langs_answer = sort_by_values(language_name_count_dict)
plot_languages_used(top_five_langs_answer[0],top_five_langs_answer[1])
# Show all followers name in the listbox 'listbox3'.
followers_response = requests.get(f"https://api.github.com/users/{username}/followers", headers=headers)
if followers_response.status_code==200:
followers_response = json.loads(followers_response.content)
# Delete all previously available elements from the listbox.
listbox3.delete(0, tk.END)
for j in range(len(followers_response)):
listbox3.insert(tk.END, followers_response[j]["login"])
else:
messagebox.showerror("Rate limit exceeded","Rate limit exceeded.\nTry after 1 hour.")
# Show all following profile's names in the listbox 'listbox4'.
followings_response = requests.get(f"https://api.github.com/users/{username}/following", headers=headers)
if followings_response.status_code==200:
followings_response = json.loads(followings_response.content)
# Delete all previously available elements from the listbox.
listbox4.delete(0, tk.END)
for j in range(len(followings_response)):
listbox4.insert(tk.END, followings_response[j]["login"])
else:
messagebox.showerror("Rate limit exceeded","Rate limit exceeded.\nTry after 1 hour.")
plot_commits(list(reponame_commits_count_dict.values())[:5],list(reponame_commits_count_dict.keys())[:5])
elif response.status_code==403:
messagebox.showwarning("Input request exceeded","You have exceeded the total number of requests to make per hour.\nTry after 1 hour.")
else:
label_name.config(text="")
label_username.config(text="")
label_user_url.config(text="")
label_user_company.config(text="")
label_bio.config(text="")
label_email.config(text="")
label_user_location.config(text="")
label_total_repositories_count.config(text="")
label_followers_count.config(text="")
label_following_count.config(text="")
messagebox.showinfo("Invalid profile","Profile not available in Github!")
# Reactivate the search button.
search_button.config(state=tk.ACTIVE)
# Function to run the function 'get_user_details()' in a separate thread.
def thread_get_user_details():
thread_var = Thread(target=get_user_details)
thread_var.start()
# GUI
root = tk.Tk()
root.geometry("1450x750")
root.minsize(width=1450,height=750)
root.title("GitHub profile viewer")
ui_background_color_primary = "#b9defe"
root.config(background=ui_background_color_primary)
current_username = ""
# PhotoImage variables
app_image = tk.PhotoImage(file="assets/logo.png").subsample(2,2)
user_icon = tk.PhotoImage(file="assets/user_icon.png").subsample(2,2)
location_pin_icon =tk.PhotoImage(file="assets/icons8-location-100.png").subsample(3,3)
email_icon = tk.PhotoImage(file="assets/icons8-email-100.png").subsample(3,3)
bio_icon = tk.PhotoImage(file="assets/icons8-information-48.png").subsample(2,2)
company_icon = tk.PhotoImage(file="assets/icons8-company-50.png").subsample(2,2)
followers_icon = tk.PhotoImage(file="assets/icons8-followers-50.png").subsample(2,2)
following_icon = tk.PhotoImage(file="assets/icons8-following-50.png").subsample(2,2)
twitter_icon = tk.PhotoImage(file="assets/icons8-twitter-squared-48.png").subsample(2,2)
url_link_icon =tk.PhotoImage(file="assets/url_link_icon.png").subsample(2,2)
repo_icon = tk.PhotoImage(file="assets/icons8-repo-50.png").subsample(2,2)
calendar_icon = tk.PhotoImage(file="assets/icons8-date-50.png").subsample(2,2)
star_icon = tk.PhotoImage(file="assets/icons8-star-50.png").subsample(2,2)
languages_icon = tk.PhotoImage(file="assets/zero_one_icon.png").subsample(2,2)
repositories_icon = tk.PhotoImage(file="assets/repo_folder_icon.png").subsample(2,2)
commit_icon = tk.PhotoImage(file="assets/commits_icon.png").subsample(3,3)
# Frame
frame1 = tk.Frame(root,background=ui_background_color_primary)
frame1.grid(row=0,column=0,pady=1)
username_var = tk.StringVar()
searchbar = tk.Entry(frame1,textvariable=username_var,font=("Arial",12))
searchbar.grid(row=0,column=0)
search_button = tk.Button(frame1,text="Search profile",command=thread_get_user_details,bg="black",fg="white",font=("Arial",12),activebackground="#000000",activeforeground="#ffffff")
search_button.grid(row=0,column=1,padx=10)
frame_first = tk.Frame(root,background=ui_background_color_primary)
frame_first.grid(row=1,column=0,columnspan=1)
frame2 = tk.Frame(frame_first,width=300,background=ui_background_color_primary,highlightthickness=0,highlightbackground="#000000")
frame2.grid(row=0,column=0)
inner_frame = tk.Frame(frame2,background=ui_background_color_primary)
inner_frame.grid(row=0,column=0)
pp_label = tk.Label(inner_frame,image=app_image,bg=ui_background_color_primary)
pp_label.grid(row=0,column=0,rowspan=3,padx=6)
label_name = tk.Label(inner_frame,font=("Times New Roman",20),width=30,anchor=tk.W,bg=ui_background_color_primary)
label_name.grid(row=0,column=1)
label_username = tk.Label(inner_frame,font=("Times New Roman",15),anchor=tk.W,image=user_icon,compound=tk.LEFT,bg=ui_background_color_primary)
label_username.grid(row=1,column=1)
label_user_url = tk.Label(inner_frame,font=("Times New Roman",15),anchor=tk.W,fg="blue",image=url_link_icon,compound=tk.LEFT,bg=ui_background_color_primary)
label_user_url.grid(row=2,column=1)
label_user_url.bind("<Button-1>",open_user_profile_in_browser)
secondary_frame = tk.Frame(frame2,background=ui_background_color_primary)
secondary_frame.grid(row=1,column=0)
tk.Label(secondary_frame,text="Bio",font=("Times New Roman",11),image=bio_icon,compound=tk.LEFT,background=ui_background_color_primary).grid(row=1,column=0)
label_bio = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,wraplength=350,bg=ui_background_color_primary)
label_bio.grid(row=1,column=1)
tk.Label(secondary_frame,text="Company:",font=("Times New Roman",11),image=company_icon,compound=tk.LEFT,background=ui_background_color_primary).grid(row=2,column=0)
label_user_company = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_user_company.grid(row=2,column=1)
tk.Label(secondary_frame,text="Email id:",font=("Times New Roman",11),image=email_icon,compound=tk.LEFT,bg=ui_background_color_primary).grid(row=3,column=0)
label_email = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_email.grid(row=3,column=1)
tk.Label(secondary_frame,text="Location:",font=("Times New Roman",11),image=location_pin_icon,compound=tk.LEFT,bg=ui_background_color_primary).grid(row=4,column=0)
label_user_location = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_user_location.grid(row=4,column=1)
tk.Label(secondary_frame,text="Followers:",font=("Times New Roman",11),image=followers_icon,compound=tk.LEFT,bg=ui_background_color_primary).grid(row=5,column=0)
label_followers_count = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_followers_count.grid(row=5,column=1,padx=5)
tk.Label(secondary_frame,text="Following:",font=("Times New Roman",11),image=following_icon,compound=tk.LEFT,bg=ui_background_color_primary).grid(row=6,column=0)
label_following_count = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_following_count.grid(row=6,column=1,padx=5)
tk.Label(secondary_frame,text="Twitter",font=("Times New Roman",11),image=twitter_icon,compound=tk.LEFT,bg=ui_background_color_primary).grid(row=7,column=0)
label_twitter = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_twitter.grid(row=7,column=1)
tk.Label(secondary_frame,text="Total repositories",font=("Times New Roman",11),image=repo_icon,compound=tk.LEFT,bg=ui_background_color_primary).grid(row=8,column=0)
label_total_repositories_count = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_total_repositories_count.grid(row=8,column=1)
tk.Label(secondary_frame,text="Account created:",font=("Times New Roman",11),image=calendar_icon,compound=tk.LEFT,bg=ui_background_color_primary).grid(row=9,column=0)
label_acct_created = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_acct_created.grid(row=9,column=1)
tk.Label(secondary_frame,text="Last modified:",font=("Times New Roman",11),image=calendar_icon,compound=tk.LEFT,bg=ui_background_color_primary).grid(row=10,column=0)
label_acct_last_modified = tk.Label(secondary_frame,font=("Times New Roman",11),anchor=tk.W,width=40,bg=ui_background_color_primary)
label_acct_last_modified.grid(row=10,column=1)
# Frame 11
frame11 = tk.Frame(frame_first,background=ui_background_color_primary)
frame11.grid(row=0,column=1)
# Frame 3
frame3 = tk.Frame(frame11,background=ui_background_color_primary)
frame3.grid(row=0,column=0,padx=7)
tk.Label(frame3,text="All Repositories",font=("Times New Roman",15,"bold"),anchor=tk.W,width=12,bg=ui_background_color_primary).pack()
listbox1 = tk.Listbox(frame3,height=7,font=("Times New Roman",12),width=45)
listbox1.pack(side=tk.LEFT,fill=tk.BOTH)
listbox1.bind("<Double-1>",get_listbox1_selected)
scrollbar = tk.Scrollbar(frame3)
scrollbar.pack(side=tk.RIGHT,fill=tk.BOTH)
listbox1.config(yscrollcommand=scrollbar.set)
scrollbar.config(command=listbox1.yview)
frame4 = tk.Frame(frame11,background=ui_background_color_primary)
frame4.grid(row=1,column=0,padx=7,pady=5)
tk.Label(frame4,text="Top Starred Repositories",font=("Times New Roman",15,"bold"),anchor=tk.W,width=20,bg=ui_background_color_primary).pack()
listbox2 = tk.Listbox(frame4,height=7,font=("Times New Roman",12),width=45)
listbox2.pack(side=tk.LEFT,fill=tk.BOTH)
listbox2.bind("<Double-1>",get_listbox2_selected)
scrollbar2 = tk.Scrollbar(frame4)
scrollbar2.pack(side=tk.RIGHT,fill=tk.BOTH)
listbox2.config(yscrollcommand=scrollbar2.set)
scrollbar2.config(command=listbox2.yview)
third_frame = tk.Frame(root,background=ui_background_color_primary)
third_frame.grid(row=2,column=0)
frame5 = tk.Frame(third_frame,background=ui_background_color_primary)
frame5.grid(row=0,column=2,padx=5)
frame6 = tk.Frame(third_frame,background=ui_background_color_primary)
frame6.grid(row=0,column=1,padx=5)
frame7 = tk.Frame(third_frame,background=ui_background_color_primary)
frame7.grid(row=0,column=0,padx=5)
frame_commits = tk.Frame(third_frame,background=ui_background_color_primary)
frame_commits.grid(row=0,column=3,padx=5)
frame22 = tk.Frame(frame_first,background=ui_background_color_primary)
frame22.grid(row=0,column=2)
# Followers list
frame8 = tk.Frame(frame22,background=ui_background_color_primary)
frame8.grid(row=0,column=0,padx=7)
tk.Label(frame8,text="Followers",fg="#000000",font=("Times New Roman",14,"bold"),bg=ui_background_color_primary,image=followers_icon,compound=tk.LEFT).pack()
listbox3 = tk.Listbox(frame8,height=7,font=("Times New Roman",12),width=30)
listbox3.pack(side=tk.LEFT,fill=tk.BOTH)
scrollbar_listbox3 = tk.Scrollbar(frame8)
scrollbar_listbox3.pack(side=tk.RIGHT,fill=tk.BOTH)
listbox3.config(yscrollcommand=scrollbar_listbox3.set)
scrollbar_listbox3.config(command=listbox3.yview)
# Following list
frame9 = tk.Frame(frame22,background=ui_background_color_primary)
frame9.grid(row=1,column=0,padx=7,pady=5)
tk.Label(frame9,text="Following",fg="#000000",font=("Times New Roman",14,"bold"),bg=ui_background_color_primary,image=following_icon,compound=tk.LEFT).pack()
listbox4 = tk.Listbox(frame9,height=7,font=("Times New Roman",12),width=30)
listbox4.pack(side=tk.LEFT,fill=tk.BOTH)
scrollbar_listbox4 = tk.Scrollbar(frame9)
scrollbar_listbox4.pack(side=tk.RIGHT,fill=tk.BOTH)
listbox4.config(yscrollcommand=scrollbar_listbox4.set)
scrollbar_listbox4.config(command=listbox4.yview)
tk.Label(frame5,text="Stars of Top Starred Repos",font=("Times New Roman",14,"bold"),bg=ui_background_color_primary,image=star_icon,compound=tk.LEFT).pack()
tk.Label(frame6,text="Languages in Repositories",font=("Times New Roman",14,"bold"),bg=ui_background_color_primary,image=languages_icon,compound=tk.LEFT).pack()
tk.Label(frame7,text="Repositories created over years",font=("Times New Roman",14,"bold"),bg=ui_background_color_primary,image=repositories_icon,compound=tk.LEFT).pack()
tk.Label(frame_commits,text="Most Commits",font=("Times New Roman",14,"bold"),bg=ui_background_color_primary,image=commit_icon,compound=tk.LEFT).pack()
# Setting application icon in the title bar.
root.iconphoto(True,app_image)
root.mainloop()