basyura's blog

あしたになったらほんきだす。

pure vim 1 行で redmine のチケットを更新する

webapi-vim を用意する。

webapi-vim: Vim Interface to Web API

Description:
    Interface to WEB APIs.
    Currently this library support following protocols.

    * Basic HTTP
    * OAuth
    * Atompub
    * SOAP (in progress)

    This library include:
        XML Parser
        BASE64 Hash Algorism
        SHA1 Hash Algorism
        HMAC HASH Algorism
webapi-vim

更新する。

call http#post('http://localhost:3000/issues/1.xml?key=YourAccessKey' , '<issue><description>hogehoge</description></issue>' , {'Content-Type' : 'text/xml'} , 'PUT')

これだけ。すごいよね。

(注意) description タグの中は HTML エスケープが必要(pre タグなどを書くと、その中が消えてしまう)。