Forums : Ohloh API Discussion

Dear Open Hub Users,

We’re excited to announce that we will be moving the Open Hub Forum to https://community.synopsys.com/s/black-duck-open-hub. Beginning immediately, users can head over, register, get technical help and discuss issue pertinent to the Open Hub. Registered users can also subscribe to Open Hub announcements here.


On May 1, 2020, we will be freezing https://www.openhub.net/forums and users will not be able to create new discussions. If you have any questions and concerns, please email us at [email protected]

Bug Reports?

Hi there,

very nice project :)

But I'm missing the link to submit bug reports for your API

There is a strange problem with the following request:

http://www.ohloh.net/projects/60/contributors.xml?v=1

There are some projects, which reponse with its HTML pages, instead of an XML document.
As far as i can see in my logs, following project_id's had send an HTML reply:

60, 499, 520, 347, 550

Additionally it would be very nice to get a direct connection between accounts and projects. Cause I did like to now, how many people are working at new zealand with PHP and Java and which projects, they are working on.

Kind Regards
GRon

gron over 16 years ago
 

Hi GRon,

We don't have a public bug list yet. The forum is the best place to get help.

The projects you are having trouble with do not have contributors, because we do not have the source code and have not created reports. Basically, the page you are requesting does not exist, and our code is trying to redirect you to the project home page. I will post a bug against the API to return an error message instead of redirecting.

To work around this problem for now, before you try to download the contributors, you will have to first retrieve the project itself and check its best_analysis_id element. If that element is empty, then the project does not have an analysis. Without an analysis, it will not have any other Ohloh data: no enlistments, no lines of code, and no contributors.

We do plan to publish the connection between accounts and projects in the API (we call these positions), but it is not implemented yet. I will bump this up the queue as the next feature to add to the API, but we are really busy lately and I can't promise a delivery time.

Thanks for trying out the API. Let me know if I can offer more help,

Robin

Robin Luckey over 16 years ago
 

Thanks, pscott. I've made the correction.

Robin Luckey over 16 years ago
 

Hi Ohloh team! First of all, great work! Now on to the requests:

  • I don't know if this is a bug or a feature, but the xml responses lack the header (I mean the <?xml version=1.0 encoding=xxx?>). I can't feed the responses to yahoo pipes because of that...
  • A little correction: on http://www.ohloh.net/api/reference/stack it says you will always receive a single Atack (instead of Stack...)

Thanks!

Mauricio Scheffer over 16 years ago
 

Hi mausch,

I am deploying the fix to add the <?xml... > declaration to the top of our API responses now.

My only concern is that we might break some existing apps that worked around our bug, but I've had this to-do list item for a long time and it was a pretty simple fix.

Yahoo Pipes appears to be working for me now -- let me know if there's any more trouble.

Thanks for reporting,

Robin

Robin Luckey over 16 years ago
 
 

Thanks Robin! works great now

Mauricio Scheffer over 16 years ago
 

Thanks Yanick -- I've fixed the typo.

Robin Luckey over 16 years ago
 

You're quite welcome. :-)

Yanick over 16 years ago
 

Two other small typos in the API:

The primarylanguagenice_name element returned within a contributorfact is primarl*ylanguagenicename*.

In the Enlistment API page, languagenicename is given as primarylanguagenice_name.

Yanick about 16 years ago
 

Hi Yanick,

I've fixed the primarly typo in the XML response.

However, I can't find the typo on the Enlistment API page. Can you help me out with some more specifics? An URL?

Thanks,
Robin

Robin Luckey about 16 years ago
 

Do'h! Sorry, I meant contributorLanguageFact (http://www.ohloh.net/api/reference/contributor_language_fact). The fifth property.

Yanick about 16 years ago
 

Thanks! It's fixed now. I have to admit I get confused myself sometimes with all of the ContributorFact, ContributorLanguageFact, etc. (and the many more such related items we have internally). :-)

Robin Luckey about 16 years ago
 

I'm getting a 406 response from certain API requests... for example
http://www.ohloh.net/projects/175/commits.xml?v=1&api_key=MY_API_KEY&page=1
Has something changed?

Mauricio Scheffer about 16 years ago
 

Commits are not accessible through the API. Did this ever work? I don't recall ever implementing it.

Robin Luckey about 16 years ago
 

Yup, commits were available through the API. In fact, I used that to build a commit chart
(now broken)

Mauricio Scheffer about 16 years ago
 

Wow. It's a long story, but what you were receiving was not actually part of the API. Yes, you were getting an XML response, but it was not a well-formed API response.

It's not entirely clear why this XML commits page even existed, but I think it was related to an Ajax callback for the interactive commits timeline, which we subsequently changed to use JSON, but the old XML interface was still active.

In short, you discovered a forgotten, deprecated XML page on our site that was not actually part of the API.

I'll consider this a request to have commits added to the API. :-)

Robin Luckey about 16 years ago
 

Oh well. I hope the commit XML comes back soon :-)
Thanks

Mauricio Scheffer about 16 years ago
 

Oh, it seems there's a duplicate request for jquery.autocomplete.min.js

Mauricio Scheffer about 16 years ago
 

A small doc omission: The sizeFact API reference (http://www.ohloh.net/api/reference/size_fact) does not mention its 'commits' property.

Yanick almost 16 years ago
 

Thanks Yanick -- this is now fixed.

Robin Luckey almost 16 years ago
 

Seems like http://www.ohloh.net/languages.xml is now returning the first ten languages instead of the full list. Is the results meant to be paginated, now?

Yanick almost 16 years ago
 

Yes, sorry Yanick -- the trouble is that the API data is generated by the same code that drives the corresponding web page. When the number of languages started getting really long, we started paginating the web result, without realizing that this also paginates the API result.

So, yes, the languages result is now paginated in the API. I'll update the docs accordingly.

Robin Luckey almost 16 years ago
 

There seems to be an oddity / bug in
http://www.ohloh.net/projects/1.xml?api_key=...&v=1

There's some escaped HTML in the XML for the logos:

<medium_logo_url> <img alt="Svn_med" src="http://bits.ohloh.net/attachments/1/svn_med.png" /></medium_logo_url>

Which should be:

<medium_logo_url>http://bits.ohloh.net/attachments/1/svn_med.png</medium_logo_url>

cheers
stuart

Stuart Yeates almost 16 years ago
 

I'm also seeing an application error with:

http://www.ohloh.net/projects/simal/contributors/165705.xml&api_key=...&v=1

Confusingly the content-type is application/xml but the contents of the error page are HTML. Maybe the Errror handling pages could reset the content-type?

Stuart Yeates almost 16 years ago