Last active
May 30, 2016 00:19
-
-
Save reline/086b2a63f0a165c2761398f13ca590ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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