Skip to content

Instantly share code, notes, and snippets.

@hideo55
Last active December 14, 2015 15:08
Show Gist options
  • Save hideo55/5105132 to your computer and use it in GitHub Desktop.
Save hideo55/5105132 to your computer and use it in GitHub Desktop.
metacpanで++er逆引き

++したユーザのIDを得る

http://api.metacpan.org/v0/favorite/_search?q=author:HIDEAKIO&fields=user,distribution

以下のようなレスポンスが得られる。

{

    "timed_out": false,
    "hits": {
        "hits": [
            {
                "_score": 10.506234,
                "fields": {
                    "user": "xwlaY4zvTSKdSmPpz58dqQ",
                    "distribution": "ArangoDB"
                },
                "_index": "cpan_v1",
                "_id": "Dk5Pj_DleGozAJJlok3gbfzqavE",
                "_type": "favorite"
            }
        ],
        "max_score": 10.506234,
        "total": 1
    },
    "_shards": {
        "failed": 0,
        "successful": 5,
        "total": 5
    },
    "took": 2

}

"user"を使ってユーザを検索

http://api.metacpan.org/v0/author/_search?q=user:xwlaY4zvTSKdSmPpz58dqQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment