zoukankan      html  css  js  c++  java
  • github 获取repo 发布的版本号

    获取最新版本

    https://api.github.com/repos/nickchou/paopao/releases/latest

    获取版本列表

    https://api.github.com/repos/nickchou/paopao/releases

    nickhou:github账号,根据需要换成需要的
    paopao:github托管的repo项目名,更换为自己想要的
    http抓取数据反序列化后解析即可

    案例:github获取最新版本(/releases/latest)返回的json

    {
      "url": "https://api.github.com/repos/nickchou/paopao/releases/12361298",
      "assets_url": "https://api.github.com/repos/nickchou/paopao/releases/12361298/assets",
      "upload_url": "https://uploads.github.com/repos/nickchou/paopao/releases/12361298/assets{?name,label}",
      "html_url": "https://github.com/nickchou/paopao/releases/tag/v1.2",
      "id": 12361298,
      "node_id": "MDc6UmVsZWFzZTEyMzYxMjk4",
      "tag_name": "v1.2",
      "target_commitish": "master",
      "name": "paopao.v1.2",
      "draft": false,
      "author": {
        "login": "nickchou",
        "id": 5896766,
        "node_id": "MDQ6VXNlcjU4OTY3NjY=",
        "avatar_url": "https://avatars2.githubusercontent.com/u/5896766?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/nickchou",
        "html_url": "https://github.com/nickchou",
        "followers_url": "https://api.github.com/users/nickchou/followers",
        "following_url": "https://api.github.com/users/nickchou/following{/other_user}",
        "gists_url": "https://api.github.com/users/nickchou/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/nickchou/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/nickchou/subscriptions",
        "organizations_url": "https://api.github.com/users/nickchou/orgs",
        "repos_url": "https://api.github.com/users/nickchou/repos",
        "events_url": "https://api.github.com/users/nickchou/events{/privacy}",
        "received_events_url": "https://api.github.com/users/nickchou/received_events",
        "type": "User",
        "site_admin": false
      },
      "prerelease": false,
      "created_at": "2018-08-11T14:16:10Z",
      "published_at": "2018-08-11T14:19:58Z",
      "assets": [
        {
          "url": "https://api.github.com/repos/nickchou/paopao/releases/assets/8212410",
          "id": 8212410,
          "node_id": "MDEyOlJlbGVhc2VBc3NldDgyMTI0MTA=",
          "name": "paopao.v1.2.rar",
          "label": null,
          "uploader": {
            "login": "nickchou",
            "id": 5896766,
            "node_id": "MDQ6VXNlcjU4OTY3NjY=",
            "avatar_url": "https://avatars2.githubusercontent.com/u/5896766?v=4",
            "gravatar_id": "",
            "url": "https://api.github.com/users/nickchou",
            "html_url": "https://github.com/nickchou",
            "followers_url": "https://api.github.com/users/nickchou/followers",
            "following_url": "https://api.github.com/users/nickchou/following{/other_user}",
            "gists_url": "https://api.github.com/users/nickchou/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/nickchou/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/nickchou/subscriptions",
            "organizations_url": "https://api.github.com/users/nickchou/orgs",
            "repos_url": "https://api.github.com/users/nickchou/repos",
            "events_url": "https://api.github.com/users/nickchou/events{/privacy}",
            "received_events_url": "https://api.github.com/users/nickchou/received_events",
            "type": "User",
            "site_admin": false
          },
          "content_type": "application/octet-stream",
          "state": "uploaded",
          "size": 120482,
          "download_count": 3,
          "created_at": "2018-08-11T14:19:42Z",
          "updated_at": "2018-08-11T14:19:46Z",
          "browser_download_url": "https://github.com/nickchou/paopao/releases/download/v1.2/paopao.v1.2.rar"
        }
      ],
      "tarball_url": "https://api.github.com/repos/nickchou/paopao/tarball/v1.2",
      "zipball_url": "https://api.github.com/repos/nickchou/paopao/zipball/v1.2",
      "body": "* 新增多线程支持
    * 新增线程可暂停、终止功能
    * 继续优化log4net日志格式
    * 窗体resize控件自使用,虽然还是有点丑,讲究用吧
    * 执行结果日期格式精简
    * 文本日志去空格换行等"
    }
    
  • 相关阅读:
    2018常用DOM操作总结
    emlog实现全站pjax无刷新加载页面
    深入理解Vuex 框架
    2018前端最火的web UI框架
    小程序快递单号查询
    表单元素系列二
    表单元素系列一
    表单提交
    AJAX 回调函数刷新页面问题
    electron 常用命令
  • 原文地址:https://www.cnblogs.com/nickchou/p/9533209.html
Copyright © 2011-2022 走看看