likes
comments
collection
share

通过脚本访问 Github 所有信息

作者站长头像
站长
· 阅读数 28

Another github v3 api implemented in viml

通过脚本访问 Github 所有信息 通过脚本访问 Github 所有信息 通过脚本访问 Github 所有信息 通过脚本访问 Github 所有信息 通过脚本访问 Github 所有信息 通过脚本访问 Github 所有信息 通过脚本访问 Github 所有信息

Intro

This is a viml library to access the Github API v3. With it, you can manage Github resources (repositories, user profiles, organizations, etc.) from viml scripts.

It is WIP, it will covers the full API.

通过脚本访问 Github 所有信息

If you have any question, any remark, or if you find a bug, or if there is something you can do with the API but not with Github-api.vim, please open an issue.

Install

It is easy to install the lib via dein:

call dein#add('wsdjeg/GitHub.vim')

NOTE: For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the user making requests.Increasing the unauthenticated rate limit, you need Create OAuth app, and set EVN: CLIENTID and CLIENTSECRET.

Usage

create issue:

function! CreateIssue(owner, repo) abort
    let username = input('your github username:')
    let password = input('your github password:')
    let title = input('Issue title: ')
    let issue = {
                \ 'title': title,
                \ 'body': s:body(),
                \ }
    let response = github#api#issues#Create(a:owner, a:repo,
                \ username, password, issue)
    if !empty(response)
        echomsg 'Create successed! ' . response.url
    else
        echom 'Create failed!'
    endif
endfunction

func! s:body()
    return 'Testting Github.vim...'
endf
转载自:https://juejin.cn/post/6844903510920658952
评论
请登录