When I wrote CoderPub before, I liked github Trending, which has no official open API. After a long search, I finally used this. This interface is not RESTful at all, and the interface requests are cumbersome and weird, as you can see in the README for this project.

These two days a little bit of leisure, he masturbated a friend in need at will. The Python language, Flask microframework and BeautifulSoup are used to parse web pages.

API Docs

Get Trending’s warehouse list API: / API /github/ Trending /? Since =(daily,weekly,monthly)

parameter instructions way type Will choose note
lang Classification of language Path form String optional Similar to the github Trending web page
since The time interval The query form String optional daily,weekly,monthly

Response: Returns a list of REPOs with the following data:

parameter instructions type instructions
avatar Owner profile picture String The url string
owner The owner String /
repo ‘name String /
desc Repo description String /
stars Select the number of stars for the interval int /
link Repo link String /

Example: the request url: anly. Leanapp. Cn/API/a lot /… Response results:

[{
    avatar: "https://avatars3.githubusercontent.com/u/69631?v=3&s=40",
    desc: "A framework for building native apps with React.",
    link: "https://github.comfacebook/react-native",
    owner: "facebook",
    repo: "react-native",
    stars: 417
},

...

{
    avatar: "https://avatars3.githubusercontent.com/u/4239472?v=3&s=40",
    desc: "A small android library to transition between a circular ImageView from one Activity to a rectangular ImageView in the launched Activity.",
    link: "https://github.comvikramkakkar/ImageTransition",
    owner: "vikramkakkar",
    repo: "ImageTransition",
    stars: 206
}]Copy the code

Get Trending’s list of developers API: / API /github/ Trending /? Since =(daily,weekly,monthly)

parameter instructions way type Will choose note
lang Classification of language Path form String optional Similar to the github Trending web page
since The time interval The query form String optional daily,weekly,monthly

Response: Returns a list of developers with the following data:

parameter instructions type instructions
avatar Developer profile picture String The url string
name Owner name String /
full_name Full name of owner String In the form of originName (NickName)
link Developer homepage Link String /

Example: the request url: anly. Leanapp. Cn/API/a lot /… Response results:

[{
    avatar: "https://avatars3.githubusercontent.com/u/69631?v=3&s=40",
    full_name: "facebook (Facebook)",
    link: "https://github.com/facebook",
    name: "facebook"
}, 

...

{
    avatar: "https://avatars3.githubusercontent.com/u/4280789?v=3&s=40",
    full_name: "wangshaolei (fearless)",
    link: "https://github.com/wangshaolei",
    name: "wangshaolei"
}]Copy the code

Currently the project has been deployed to LeanCloud, using a free host with usage restrictions, there may be problems, only for testing entertainment.

The requested url: anly. Leanapp. Cn /

Project source address :GithubTrending