Articles / freshmeat XML-RPC API avail...

freshmeat XML-RPC API available

freshmeat.net is primarily a Web-accessible database. However, apart from requesting interface improvements for the Web part, a lot of people requested scriptable access to our database. As of this writing, we have the first version of our XML-RPC API available for you to use (that's not abuse there!). Click below for details and API specs.

To use the API, you're required to be a registered user of freshmeat.net. This makes sense because, for now, the primary use of it is release submission automation through scripted release managers and the like.

Currently, the feature set includes the retrieval of branches for a given project and the data of pending release submissions, submission of new releases, and withdrawal of pending releases. This obviously only works for projects for which you're an admin. (We have instructions available on how to request ownership in case you're developing an application but do not own its freshmeat project record.)

All functions return appropriate error codes for error conditions (a list of which can be found in the API docs linked to below) and exit gracefully upon encountering an error.

The first sample implementation is freshmeat-submit and comes from Eric S. Raymond of fetchmail fame. He and I worked closely together to make this interface as usable and error-free as possible. Thanks for your co-operation, Eric!

The most recent copy of the API docs is (and always will be) available in the FAQ.

All that being said, the API is evolving. We'll have more features available as you request them (and they make sense). And keep in mind, don't ruin the fun for everybody by abusing or excessively using the API.

Thanks,

Patrick Lenz (scoop)
freshmeat.net Site Manager and Senior Developer

RSS Recent comments

16 Dec 2003 08:46 ruok

URL?
What URL should client apps use to run these methods? I tried www.freshmeat.net/RPC, but that just does a search for "rpc".

16 Dec 2003 08:52 scoop

Re: URL?

> What URL should client apps use to run
> these methods? I tried
> www.freshmeat.net/RPC, but that
> just does a search for "rpc".

The URL is freshmeat.net/
xmlrpc which I just added to the FAQ as
well.

16 Dec 2003 10:32 jerri

Why not SOAP?
Why did you use XML RPC and not instead SOAP, which is a W3C Standard? Did you have any reasons to use XML RPC?

Specially in PHP "XML RPC" is a lot more complicated to program than SOAP (with the nusoap-Library).

As I already have programmed clients for XML RPC and SOAP and several Servers in SOAP, i am interested in your reasons.

btw: Sorry for my bad english.

btw2: This nevertheless is a great addition to freshmeat! Thanks a lot!

16 Dec 2003 10:44 scoop

Re: Why not SOAP?

> Why did you use XML RPC and not instead
> SOAP, which is a W3C Standard? Did you
> have any reasons to use XML RPC?

I guess it's just the tip of the iceberg. I
had a couple of requests for an XML-RPC
interface and none specifically for a SOAP
interface. But since it's all a matter of
abstraction it wouldn't be hard to implement
one based on SOAP as well (given popular
demand).

16 Dec 2003 10:57 pkocmid

Security?
Once automated, no one will be checking his
sumbmission correctness manually. If
woman-in-the-middle attacker hijacks SID, she can
quickly withdraw then submit her own url. Ouch...
What about ssl?

16 Dec 2003 11:03 scoop

Re: Security?

> Once automated, no one will be checking
> his
> sumbmission correctness manually.

*meep* Wrong.

Even if it is automated for project
managers it is and will be a manual
verification task for freshmeat.net staff
members.

16 Dec 2003 11:32 sergiocarvalho

Re: Why not SOAP?
And why not XML-RPC? It is much much simpler. You can actually look at the text on the wire and understand what's going on. SOAP is much more convoluted.

For PHP, I recommend the Pear XML-RPC implementation.

> Why did you use XML RPC and not instead
> SOAP, which is a W3C Standard? Did you
> have any reasons to use XML RPC?

16 Dec 2003 14:50 fuck

Re: Why not SOAP?

I'm inclined to agree. SOAP can be extremely simple when WSDL is used. Take this perl example:

use SOAP::Lite;

print SOAP::Lite

-> service('www.xmethods.net/sd/St...;)

-> getQuote('MSFT');

That's it.

17 Dec 2003 00:01 IvoLimmen

Re: Security?

> Once automated, no one will be checking
> his
> sumbmission correctness manually. If
> woman-in-the-middle attacker hijacks
> SID, she can
> quickly withdraw then submit her own
> url. Ouch...
> What about ssl?

If a hacker really wants your SID, he/she will get it anyways... once and awhile you do login to the website.

19 Dec 2003 07:00 nwalsh

License values?
What are the values for the license tag? (More generally, what are the values for all the tags that expect a delimited set of values)

I tried to use ESR's freshmeat-submit to send a branch update and I got the "100" error back. So I tried to explicitly set the license to "MIT/X Consortium License" because that seemd like the most reasonable thing. I got "100" back again.

Help?

(P.S. Yes, I'll send a bug report off to ESR as well.)

19 Dec 2003 07:38 scoop

Re: License values?

> What are the values for the license tag?
> (More generally, what are the values for
> all the tags that expect a delimited set
> of values)

Any of the nodes in the license root category is
valid. You can also check our license listing
the FAQ (/faq/view/48/).

> I tried to use ESR's freshmeat-submit to
> send a branch update and I got the
> "100" error back. So I tried
> to explicitly set the license to
> "MIT/X Consortium License"
> because that seemd like the most
> reasonable thing. I got "100"
> back again.

That should be fixed now. You don't have
to supply a license value and the interface
erroneously expected one.

25 Dec 2003 08:39 yow

Test mode needed?
Merry Christmas all!

Thanks a lot Patrick, this is a fantastic addition! Two suggestions:

(1) A very important addition is a "test" mode... you don't want us to learn how to publish a release by trial and error!!

How to implement? Only for things that change the database, so only for:
    publish_release
    withdraw_release

Idea 1: just add a "test" argument for each of these, since there's only two.
Idea 2: could logon in "test" mode. This is what my online credit card acceptor does, so you can test it out fully, before "going live". You are less likely to forget it, if you need only set it once, and it's easier to change if in just one place. But it might be much more trouble for you, with the database on the server side...

(2) I assume that all arguments are strings for the protocol (apart form the structs, of course)? Specifically, the "release focus ID" might be an int... if so, this could be part of the documentation in the FAQ.

BTW: I grabbed apache's xmlrpc ws.apache.org/xmlrpc/ (ws.apache.org/xmlrpc/) for Java to do this... seems to work well. They have a nice short example of code, and mappings of XMLRPC types to Java types (eg a struct is a Hashtable).

Finally, in the XMLRPC vs SOAP debate, I really much prefer simpler... but I never get to see the XML in practice, at all (except for the error message, when viewing it with a web-browser). Simple XML would be *great* if you could play with the server manually via telnet, but because HTTP demands that you count the characters to give a length, it's impossible... unless you write a tool to do that, but then you might as well just use a proper tool for XMLRPC... so, XMLRPC or SOAP, it just doesn't matter so far as the protocol is concerned.

Cheers,
Brendan

13 Jan 2004 03:25 johnnewbigin

Re: URL?
What about an https url?

21 Feb 2004 08:53 hatemben

PHP class to use the Freshmeat.net xml-rpc interface
i liked the xml-rpc interface, and I just written a php class that could help those who prefer playing with php code :) it will be soon on phpclasses.org (www.phpclasses.org/bro...) and until that time you can email me to request this class "for free" of course : info at dynamix-tn dot com

Regards,
Hatem

23 Feb 2004 07:45 hatemben

Re: PHP class to use the Freshmeat.net xml-rpc interface
Well you can download the class from here (www.dynamix-tn.com/fre...).

Regards,
Hatem

06 Mar 2004 06:09 frewert

Apache Ant Task
As I didn't found any ant task for submitting releases to freshmeat, I decided to write one.
If nobody stops me, you will face an initial release within the next days ;-)

Cheers, Carsten

06 Mar 2004 08:53 jeffcovey

Re: Apache Ant Task
Sounds fun; thanks. :)

09 Mar 2004 04:42 MnO_Raphael

only submission functions?
I can't seem to find any functions beside project submission related ones. All I need is to get very basic information about specific projects in a scriptable manner. Am I blind or will this be implemented soon? I'd really hate to parse the HTML to get what I need.

09 Mar 2004 04:49 scoop

Re: only submission functions?

> All I need is to get very basic
> information about specific projects in a
> scriptable manner.

That's what the XML backends are for. We have a per-
project
XML file available via /projects-xml/<projectshortname>
/ (for
example the Linux
entry) and global dumps of the database contents
available in our backend directory</
a>.

09 Mar 2004 07:14 MnO_Raphael

Re: only submission functions?
Cool, that's exactly what I need. Whish I'd found it a little earlier though ;)

14 Mar 2004 15:18 flamingcow66

Excessive authentication complication?
Why the excessive complication of the session ID,
with login/logout functions? XML RPC is already on
top of HTTP, and HTTP authentication could do the
job quite nicely (and is already supported by most
XML RPC client implementations). This would turn a
simple release into 1 easily command-line
scriptable call, instead of 3.

Also, seconding (thirding?) the requests for an SSL
interface to this (and possibly to the main page
login).

10 May 2004 19:26 mrmlk

Re: Apache Ant Task

> As I didn't found any ant task for

> submitting releases to freshmeat, I

> decided to write one.

How goes it?

21 May 2004 20:57 BuyGifts

Re: URL?

> What about an https url?

>

I dont think there is one. Although it would be very nice to have a secure url.

22 Jun 2004 04:01 Jerry88

Re: Apache Ant Task

> As I didn't found any ant task for
> submitting releases to freshmeat, I
> decided to write one.
> If nobody stops me, you will face an
> initial release within the next days
> ;-)
>
> Cheers, Carsten

That's great! It will be useful for me, how is it going?

22 Jun 2004 04:09 Wallace86

Re: PHP class to use the Freshmeat.net xml-rpc interface

> i liked the xml-rpc interface, and I
> just written a php class that could help
> those who prefer playing with php code
> :) it will be soon on phpclasses.org
> (www.phpclasses.org/bro...)
> and until that time you can email me
> to request this class &quot;for
> free&quot; of course : info at
> dynamix-tn dot com
>
> Regards,
> Hatem

That's great.

Thanks, Hatem.

12 Jul 2004 05:35 frewert

Re: Apache Ant Task

[...]

> That's great! It will be useful for me,

> how is it going?

First of all, sorry for not being on schedule at all...

There were other things to do, and I put the nearly finished first release on hold.

Now the good news: I'm going to do some final tests and should be able to release the task today.

Cheers, Carsten

13 Jul 2004 02:43 frewert

Re: Apache Ant Task
Well, here it is:
www.frewert.de/archive...

The included README.html isn't finished, but the example
should be enough to discover the first bugs ;-)

Have fun, Carsten

13 Jul 2004 10:37 marser

garbage in response
This is a great idea, thanks to the ppl who put it together!

The one problem I'm having is that there seems to be some leading/trailing characters in the response body. It makes it real difficult to parse the body as XML.

Here's an example of what I get back from the freshmeat server:

HTTP/1.1 200 OK

Date: Sun, 27 Jun 2004 12:03:39 GMT

Server: Apache/1.3.29 (Unix) PHP/4.3.6

X-Powered-By: PHP/4.3.6

X-Accelerated-By: PHPA/1.3.3r2

Content-encoding: ISO-8859-1

Connection: close

Transfer-Encoding: chunked

Content-Type: text/xml

1fd

&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&gt;

&lt;methodResponse&gt;

...etc

The problem I have is with the spurious '1fd' that appears before the XML declaration. There's often some trailing characters as well, eg 'CRLF 0'.

Is it an issue to do with the PHP backend?

regards,

/m

13 Jul 2004 11:02 scoop

Re: garbage in response
I repeatedly challenged the XML-RPC backend with queries and
never got the garbage you mentioned. Are you going
through some sort of proxy server that could be intervening here?

13 Jul 2004 15:31 marser

Re: garbage in response

> I repeatedly challenged the XML-RPC

> backend with queries and

> never got the garbage you mentioned.

I'm not using a proxy, but it could be a problem with my client implementation.

I've tried two otherwise identical requests, one using HTTP 1.1 and the other HTTP 1.0.

1.0 works, but using 1.1 I always get the extra characters!

13 Jul 2004 22:54 scoop

Re: garbage in response
Indeed, using HTTP/1.1 I get the extra characters as well. I'll look
into it, please stick to HTTP/1.0 for the meantime.

24 Jul 2004 17:37 milky

Re: garbage in response

It has to do with the HTTP version you are using. The
"Transfer-encoding:chunked\r\n" signalizes that such garbage
is inside the response. It in fact is no garbage, but a simple fragmentation
mechanism for the response - unless output buffering is used all PHP scripts
lead to such responses.

Simply stick with HTTP/1.0 if you don't want to deal with it. Btw, there
are more dependencies than this (for example content-coding) to declare
something a HTTP/1.1 client; so please don't send such a header
unless you have a real library. Google after RFC2616 for a weekend reading.

04 Aug 2004 17:02 marser

Re: garbage in response
Okay, thanks.
I'll take your advice and RTFM.

04 Oct 2004 11:49 myds2

where to find values of the discriminators
Hi I'm new to freshmeat. How can I find out the corresponding category that each of the numbers in Trove categories represents? for example, &lt;trove_id&gt;201&lt;/trove_id&gt;, what does 201 stand for?

Thanks a lot!

05 Oct 2004 06:06 jeffcovey

Re: where to find values of the discriminators

I asked scoop about this, and he doesn't think it's worthwhile for us to
keep a list of the categories and their numbers. He suggests that you
download and keep a copy of download.freshmeat.net... (download.freshmeat.net...)
instead.

Sincerely,

Jeff

05 Oct 2004 13:05 myds2

Re: where to find values of the discriminators
Thanks, I got it.

18 Oct 2004 17:18 stefw

Re: garbage in response

> Indeed, using HTTP/1.1 I get the extra

> characters as well. I'll look

> into it, please stick to HTTP/1.0 for

> the meantime.

That looks a lot like HTTP/1.1 chunked encoding or keep-alives. It lists the number of bytes to read in the next chunk before the content. They're not junk chars.

04 Dec 2004 12:06 sid007

API
Wow this is great Patrick! I would be very much interested in the API.

14 Dec 2004 00:44 iRude

Re: PHP class to use the Freshmeat.net xml-rpc interface
yes! I agree,

My XML / RSS avail. here RSS iRude (www.irude.com/wp-rss2.php)

16 Dec 2004 05:03 pintman

Login incorrect
Whenever i try to fetch e.g. the list of available projects of and account - or even just try to logout - i get an Login incorrect-Error. Of course i performed a login before and got a SID - without getting this error. Any ideas why there are these problems?

19 Dec 2004 07:04 pintman

Re: Login incorrect
I've used the API the wrong way and invoked the login-command instead using the logout-command. shame on me. ;)

06 Apr 2007 12:16 mdnava

Re: Broken link

> Well, here it is:
> www.frewert.de/archive...
>

Link does not work (404), can you update?
Mel

12 Aug 2007 05:30 frewert

Re: Broken link

%

%% www.frewert.de/archive...

>

> Link does not work (404), can you

> update?

Sorry for not stopping by for such a long time.

You can get a copy of antmeat at antmeat.sourceforge.net/

Cheers

Carsten

23 Apr 2014 04:39 Avatar starstube

nice

Screenshot

Project Spotlight

Attic

A deduplicating backup program.

Screenshot

Project Spotlight

psensor

A graphical temperature monitor for Linux.