“What’s the most interesting project you’ve seen on GitHub?” An answer to the question of the weekend, more interesting and novel to share with the front of the trend of the students.
So where’s the fun?
The answer is to turn your Github page into a blog home page with an automatic daily display of updated information
Github released a new Easter egg a few days ago that will automatically display the README of your repository at the top of your profile, like github.com/tw93
I automatically run my open source repository, blog, WakaTime and Douban.com daily through Github Actions, and then write them into README. The programmability has been greatly improved, and it is very trendy!
How to achieve, a knowledge point to everyone synchronization
Preliminary knowledge
-
How to make the lot of your personal page shows the contents of the Markdown, visible www.aboutmonica.com/blog/how-to…
-
How to use Github Actions to automate content, see github.com/features/ac…
Automate clever ways of getting information
The above implementation can be seen in detail tw93/ TW93 warehouse, there are several good implementation:
1. Take advantage of Github’s Api
For example, the Product Releases in the image is achieved by using the Github Graphql Api with the help of The GraphqlClient in Python. First get all the warehouse field information of the current user and then use string concatenation to create the desired format
2. It’s convenient to use RSS addresses on websites
In Recent Blog and Funny Soul, for example, Blog information can be accessed quickly using feed.xml
At that time, I thought about using Python to climb the corresponding information of Dynamic information of Douban, but the implementation will be relatively poor. The login state needs to be maintained for a period of time. When I happened to process personal page information, I saw the following feed RSS.
Rss information processing can be integrated through feedParser to obtain the corresponding Rss content array, and then splice
3. Leverage apis provided by automated tools
For example, in the Weekly Development Breakdown above, it is highly recommended that you use wakatime to measure your code time. You can use Google for details.
How to draw the following diagram, can refer to the code in TW93 /waka-box, use wakatime-client to fetch information, and then also perform string splice. because the previous fork changes, will eventually generate a GIST
Finally, use HTTPX to fetch the corresponding raw text content, and then use markDown’s code syntax to insert into MarkDown
More ideas
Combining Github Profile Readme with Actions allows you to do more interesting things. For example, you can automatically generate the articles you need to see every day on the front page, so you don’t need to look for them. See github.com/simonw. Some of the treatments for the weekend took a page from simonw
Another “fun way to fool around” is to record an MP4 and then convert it into a GIF and put it on the home page, which is more interesting, such as PraveenScience
There is also a “more deceptive”, directly to play the game moved to the home page, although it is a picture, but there are a lot of people playing, and there is a ranking, such as Timburgan
Last But Not Least
All of a sudden, I feel that foreign programmers are very good at playing, very popular, worth our learning and communication, less meaningless classes, write more interesting code;
At present, Ali Flying Pig is urgently recruiting P6 front end, the whole Ali front P6 HC is not much, for students who want to enter Ali rare opportunity, a very trendy and mature front end team, very welcome to join [email protected], of course, you can also leave a message directly after following the wechat public account