A simple way to get Gitlab data underneath the shell

Source: Internet
Author: User
Tags curl

We use Gitlab in the company intranet to build a Git server, in the actual use, need to get some warehouse data, but I do not understand the web, so I intend to directly on the server to do the warehouse processing, extraction information, and now intend to first from the extraction colleagues to do the comment , that is, the comments submitted to do, how to do?
Or Gitlab has a thread interface that can be used.

Effective reply

Use curl to access those interfaces directly, and then parse JSON.

Do not curl, quickly write a jquery, $.ajax () your Gitlab URL plus the API address.

Like you want to see commits

$.ajax ({
URL: "http://your gitlab url/api/v3/projects/:id/repository/commits",///connection reference upstairs Gitlab API doc
Method: ' Get '
})
. Done (function (data) {
var commithistory = data;
Then just play with the data object, such as drawing your commit message on the page, and so on.
});

The data here should grow this type.
[
{
"id": "ed899a2f4b50b4370feeea94676502b42383c746",
"short_id": "Ed899a2f4b5",
"title": "Replace sanitize with Escape once",
"Author_name": "Dmitriy Zaporozhets",
"Author_email": "dzaporozhets@sphereconsultinginc.com";
"Created_at": "2012-09-20t11:50:22+03:00",
' Message ': ' Replace sanitize with escape once '
},
{
"id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
"short_id": "6104942438c",
"title": "Sanitize for network graph",
"Author_name": "Randx",
"Author_email": "dmitriy.zaporozhets@gmail.com";
"Created_at": "2012-09-20t09:06:12+03:00",
' Message ': ' Sanitize for network graph '
}
]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.