@@ -279,9 +279,64 @@ def addWatchDetails(self):
279
279
self .body ["text" ] = f"{ self .createTitle ()} #stargazer"
280
280
login = self .senderJson ["login" ]
281
281
loginUrl = self .senderJson ["html_url" ]
282
+ userUrl = self .senderJson ["url" ]
282
283
starCount = self .repoJson ["stargazers_count" ]
283
284
284
- bodyText = f"[{ login } ]({ loginUrl } ) is stargazer number { starCount } "
285
+ bodyText = f"[{ login } ]({ loginUrl } ) is stargazer number { starCount } \n \n "
286
+
287
+ try :
288
+ r = requests .get (userUrl )
289
+ print (f"Get User Info Response Status: { r .status_code } " )
290
+ # print(r.headers)
291
+ # print(r.content)
292
+
293
+ userDetailsJson = json .loads (r .content )
294
+
295
+ name = userDetailsJson ['name' ]
296
+ company = userDetailsJson ['company' ]
297
+ location = userDetailsJson ['location' ]
298
+ email = userDetailsJson ['email' ]
299
+ twitter = userDetailsJson ['twitter_username' ]
300
+ blog = userDetailsJson ['blog' ]
301
+ bio = userDetailsJson ['bio' ]
302
+
303
+ if name is not None and name :
304
+ bodyText += f"\n Name: { name } "
305
+
306
+ if company is not None and company :
307
+ bodyText += f"\n Company: { company } "
308
+
309
+ if location is not None and location :
310
+ bodyText += f"\n Location: { location } "
311
+
312
+ if email is not None and email :
313
+ bodyText += f"\n Email: { email } "
314
+
315
+ if twitter is not None and twitter :
316
+ bodyText += f"\n Twitter: { twitter } "
317
+
318
+ if blog is not None and blog :
319
+ bodyText += f"\n Blog: { blog } "
320
+
321
+ if bio is not None and bio :
322
+ bodyText += f"\n Bio: { bio } "
323
+
324
+ except Exception as e :
325
+ print (f"Exception retrieving user info: { e } " )
326
+
327
+ try :
328
+ # HTML not supported in Mattermost markdown...
329
+ # bodyText += "\n\n<details><summary>GitHub Stats</summary>"
330
+ bodyText += f"\n \n "
331
+ # bodyText += "\n</details>"
332
+
333
+ # These stats only cover the repos in the user's home (not all languages used in commits in any repo...)
334
+ # bodyText += "\n\n<details><summary>Top Langs</summary>"
335
+ # bodyText += f"\n\n"
336
+ # bodyText += "\n</details>"
337
+ except Exception as e :
338
+ print (f"Exception retrieving stats image: { e } " )
339
+
285
340
self .attachment ["thumb_url" ] = self .watchThumbnail
286
341
self .attachment ["color" ] = self .watchColor
287
342
self .attachment ["text" ] = bodyText
0 commit comments