Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8378079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:50:34+00:00 2026-06-09T15:50:34+00:00

First of all, thanks for reading. I am hosting my current projects on GitHub.

  • 0

First of all, thanks for reading.

I am hosting my current projects on GitHub. Using GitHub Pages, I ]host my personal blog, you can reach the blog here.

On the blog, I have a page dedicated to all the projects I am currently working on. Basically, I wanted to display the list of all my on-going projects automatically, via querying GitHub.

While Googling a lot, I found that this can be achieved using JavaScript.
I tried it, but it didn’t work as expected. When loading the page, I just get the text message ‘Querying GitHub for repositories’. And nothing seems to happen.

I contacted GitHub maintainers, and they kindly replied that this technique uses an outdated version of the GitHub API.

As I am not experienced in JavaScript, can anyone help me to fix it ?

Regards,
Roland.


Here is the code I used inside the HTML page

<div id="opensource-projects"></div> 

<!-- JavaScript to load and display repos from GitHub -->
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="/javascripts/git.js" type="text/javascript"></script>
<script type="text/javascript">
  $(function() {
    $("#opensource-projects").loadRepositories("Yonaba");
  });
  </script>

Then, inside the file git.js, I have the following:

// http://aboutcode.net/2010/11/11/list-github-projects-using-javascript.html

jQuery.githubUser = function(username, callback) {
  jQuery.getJSON("http://github.com/api/v1/json/" + username + "?callback=?", callback);
}

jQuery.fn.loadRepositories = function(username) {
  this.html("<span>Querying GitHub for " + username +"'s repositories...</span>");

  var target = this;
  $.githubUser(username, function(data) {
    var repos = data.user.repositories;
    sortByNumberOfWatchers(repos);

    var list = $('<dl/>');
    target.empty().append(list);
    $(repos).each(function() {
      list.append('<dt><a href="'+ this.url +'">' + this.name + '</a></dt>');
      list.append('<dd>' + this.description + '</dd>');
    });
  });

  function sortByNumberOfWatchers(repos) {
    repos.sort(function(a,b) {
      return b.watchers - a.watchers;
    });
  }
};

@jcolebrand: Thanks for your kind help, but i didn’t really get what you meant. I tried sending some command to Chrome’s console, too. I guess $ is an alias for jQuery, isn’t it? Well, sending same stuff The console just outputs multiple objects, describing my repos. Awesome!
I think the issue is now parsing them properly and display them. Gee, I need to learn JavaScipt syntax for that…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:50:36+00:00Added an answer on June 9, 2026 at 3:50 pm

    The script that you posted isn’t working because the URL is for the older API. Change the URL to this and it should work for you.

    https://api.github.com/users/YOUR_USERNAME_HERE/repos?callback=CALLBACK
    

    Note: callback=<YOUR_CALLBACK> is optional.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all,thanks for reading my question. i have the following Json as a
first of all thanks for reading. I have a web application that heavily uses
Hey guy's First of all thanks for reading this. I'm having trouble to find
Thanks for reading. First of all, I got one .htaccess inside my root directory
Firs of all thanks for reading this. I'm having trouble updating the progress from
First and foremost, thank you all for reading this and helping, I'm very grateful.
First of all thanks in advance, this has been very frustrating and I'm hoping
first of all thanks for taking your time! I'm a junior Dev, working with
First of all thanks for taking the time to look into this. I store
First off thanks to all the users who have made my android developing adventure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.