Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
185
rated 0 times [  191] [ 6]  / answers: 1 / hits: 18457  / 12 Years ago, thu, january 17, 2013, 12:00:00

If I was to go about displaying just MY github repositories and their contents on an external website how would i go about doing this? Are there any source code's you can provide me with, if not point me in the right direction? I'm quite a beginner to programming so any help is appreciated. Thank you everyone.
Taking a glance at their website



I glanced over relevant links- but still have no clue how I would accomplish this.



-Github List all Repo's



-Github List all Repo content


More From » php

 Answers
14

all of the previous answers are great. however if you are looking for a quick and dirty example of how to get a list of publicly available repos then check out my jsfiddle.



which uses this ajax call to list all of a users public repos:



$(#btn_get_repos).click(function() {
$.ajax({
type: GET,
url: https://api.github.com/users/google/repos,
dataType: json,
success: function(result) {
for(var i in result ) {
$(#repo_list).append(
<li><a href=' + result[i].html_url + ' target='_blank'> +
result[i].name + </a></li>
);
console.log(i: + i);
}
console.log(result);
$(#repo_count).append(Total Repos: + result.length);
}
});
});


to see what kind of data is returned just check the console after clicking the button or you can install Google Chromes JSONView extension and then just visit the url that the ajax request is making i.e. https://api.github.com/users/google/repos


[#80786] Thursday, January 17, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zahrafrancisr

Total Points: 176
Total Questions: 105
Total Answers: 99

Location: Svalbard and Jan Mayen
Member since Sun, Sep 25, 2022
2 Years ago
;