Skip to content

Instantly share code, notes, and snippets.

@reline
Last active May 30, 2016 00:19
Show Gist options
  • Save reline/086b2a63f0a165c2761398f13ca590ea to your computer and use it in GitHub Desktop.
Save reline/086b2a63f0a165c2761398f13ca590ea to your computer and use it in GitHub Desktop.
function gitlabFeed($privateToken) {
$.ajax({
type: "GET",
url: "http://cors.io/?u=https://gitlab.com/dashboard/projects.atom?private_token=" + $privateToken,
cache: false,
dataType: 'xml',
success: function(result) {
console.log("projects.atom loaded");
var feed = $("<div>",{html: result.firstChild});
var gitlabActivity = $("#gitlabActivity");
gitlabActivity.html(feed);
var summaries = [];
$("summary").each(function () {
summaries.push(this);
});
gitlabActivity.html(summaries);
$('.gitlab a').each(function () {
var href = $(this).attr('href');
if (href) {
href = "https://gitlab.com" + href;
$(this).attr('href', href);
$(this).attr('target', "_blank");
}
});
$("#gitlab-container").addClass("atom-container");
},
error: function (err) {
console.log("AJAX error in request: " + JSON.stringify(err, null, 2));
},
async: true
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment