Code Monkey home page Code Monkey logo

github-trending's Introduction

Github trending

This repository is a GitHub trending API power by FastAPI and Scrapy parsel.
It was deployed to Vercel.


Run & Deploy

Run in development
python -m venv .venv
.venv/Scripts/Activate
pip install -r requirements.txt
uvicorn main:app --reload

Run in Docker

docker build -t trending . && docker run --rm -p 8000:80 trending

Deploy to Vercel

Just fork this repository, and import it in your Vercel dashboard.

All the requests main adrress is this:https://trend.doforce.us.kg

Swagger Docs

Get the trending repositories from /repo

Parameters
Name Type Description
lang string optional, default is "", the language of trending repository
since string optional,default is "daily", daily/weekly/monthly

For example request this address: https://trend.doforce.us.kg/repo?lang=java&since=weekly

//status code: 200
// up to 25 items
[
  {
    "repo": "/StarRocks/starrocks",
    "desc": "StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries. InfoWorld’s 2023 BOSSIE Award for best open source software.",
    "lang": "Java",
    "stars": 6338,
    "forks": 1437,
    "build_by": [
      {
        "avatar": "https://avatars.githubusercontent.com/u/57167462?s=40&v=4",
        "by": "/amber-create"
      },
      {
        "avatar": "https://avatars.githubusercontent.com/u/98087056?s=40&v=4",
        "by": "/evelynzhaojie"
      },
      {
        "avatar": "https://avatars.githubusercontent.com/u/4351040?s=40&v=4",
        "by": "/sduzh"
      },
      {
        "avatar": "https://avatars.githubusercontent.com/u/104624482?s=40&v=4",
        "by": "/EsoragotoSpirit"
      },
      {
        "avatar": "https://avatars.githubusercontent.com/u/34912776?s=40&v=4",
        "by": "/stdpain"
      }
    ],
    // How many stars did it gain this week/day/month
    "change": 619
  }
]

Get the trending developers from /user

Parameters
Name Type Description
lang string optional, default is "", the language of trending repository
since string optional,default is "daily", daily/weekly/monthly
sponsorable string optional,default is "", Whether the developer was sponsored, "1" is true, others is false

For example request this address: https://trend.doforce.us.kg/user?lang=java&since=weekly

//status code: 200
// up to 25 items
[
  {
    // developer's GitHub avatar
    "avatar": "https://avatars.githubusercontent.com/u/322311?s=96&v=4",
    // developer's nickname
    "name": "Ben McCann",
    // developer's GitHub name
    "github_name": "/benmccann",
    "popular": {
      // developer's popular repository
      "repo": "/benmccann/NameMatching",
      // developer's popular repository description
      "desc": "My entry (Yet Another Team Challenge) to MITRE's name matching competition"
    }
  }
]

Get all the avialiable trending languages in GitHub from /lang

For example,request this address: https://trend.doforce.us.kg/lang

//status code: 200
// about 700 items
[
  {
    // The display language name
    "label": "Unknown languages",
    // the language name which is used to search repositories and developers
    "key": "unknown"
  },
  {
    "label": "Python",
    "key": "python"
  },
  {
    "label": "C#",
    "key": "c%23"
  }
]

Exception

If the server does not get the resources, or the query parameters you input don't match anything, the response will be like:

//status code: 200
[]

github-trending's People

Contributors

dependabot[bot] avatar doforce avatar lissy93 avatar rahulbgautam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

github-trending's Issues

Pay attention

I modified the repo and developer interface,and add the language interface,please check the document.Also,I replaced tornodo to flask,because I think it is easy to maintain.

content-type问题

此时的Content-Type: text/html; charset=UTF-8,因为里面的内容都是以json格式给出,最好让content-type为application/json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.