-
-
Notifications
You must be signed in to change notification settings - Fork 951
feat: Add a script to update showcased projects' stars #5992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add a script to update showcased projects' stars #5992
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to suggest an alternative approach that makes this a little easier to maintain.
-
extract PROJECTS in to its own Python file. Call it
project_data.py
or something like that. -
Add a new Python file that maps the project name on to the star count. Call it something lke
project_stars.py
STAR_COUNTS = { "dolpie": "3.2K", "posting": "6.2K" }
-
Implement a script that loads PROJECTS, runs through each project to get the stars, and then spits out
project_stars.py
-
Now in
project_data.py
, you can importproject_stars
and change the stars toSTAR_COUNTS["dolphie"]
etc.
Why do I think this is better? It keeps the project data and star counts in one place. Right now the project information is duplicated over two files. It also avoid writing to a complex Python file. Generating code can be brittle, and it is generally best to limit the potential impact of that.
Would you like to tackle this?
So you want me to extract the |
4c82397
to
738e3a7
Compare
738e3a7
to
ca1b1fd
Compare
ca1b1fd
to
204936b
Compare
204936b
to
87aa6b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully this runs without crashing now? It would be nice to see the updated star counts to check they match how they are displayed on GitHub?
Awesome. Thanks @NSPC911 ! And thanks @TomJGooding for the assist. |
Please review the following checklist.