Can anyone get this to work with the Bitbucket API?

Matthew Hawley

Well-known member
I want to retrieve a list of user's bitbucket repos. I did it with Github but I can't get it to work with Bitbucket.

Here is what I am using for Github.
Code:
<script type="text/javascript">
    $(function() {
        $.ajax({
            type: "GET",
            url: "https://api.github.com/users/{$user.customFields.github}/repos",
            dataType: "json",
            success: function(result) {
                for (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(" " + result.length);
          
            
            }
        });
});
</script>

<li id="ourTab" class="profileContent">

    <div class="githubTitle">Repositories - <div id="repo_count" style="margin-left: 95px;margin-top: -19px;"></div></div>
  
    <div id="repos">
        <ul id="repo_list" ></ul>
    </div>
    <div id="repo_content">
  
    </div>
</li>

Here is the restbrowser for the bitbucket api http://restbrowser.bitbucket.org/

Thanks! :)
 
Last edited:
Top Bottom