fmII
Sat, May 17th home | browse | articles | contact | chat | submit | faq | newsletter | about | stats | scoop 00:56 PDT
in
Section
login «
register «
recover password «
[Article] add comment [Article]

 freshmeat XML-RPC API available
 by Patrick Lenz, in freshmeat - Tue, Dec 16th 2003 00:00 PDT

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

[Comments are disabled]

 Comments

[»] Login incorrect
by Marco Bakera - Dec 16th 2004 05:03:35

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?

[reply] [top]


    [»] Re: Login incorrect
    by Marco Bakera - Dec 19th 2004 07:04:48

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

    [reply] [top]


[»] API
by sid007 - Dec 4th 2004 12:06:06

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

--
FavWebLinks Affordable Web Hosting Free Web Templates

[reply] [top]


[»] where to find values of the discriminators
by myds2 - Oct 4th 2004 11:49:43

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, <trove_id>201</trove_id>, what does 201 stand for?
Thanks a lot!

[reply] [top]


    [»] Re: where to find values of the discriminators
    by jeff covey - Oct 5th 2004 06:06:19

    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 http://download.freshmeat.net/backend/fm-trove.rdf instead.

    Sincerely,
    Jeff

    --
    vs lbh pna ernq guvf, lbh'er n trrx.

    [reply] [top]


      [»] Re: where to find values of the discriminators
      by myds2 - Oct 5th 2004 13:05:48

      Thanks, I got it.

      [reply] [top]


[»] garbage in response
by martin klang - Jul 13th 2004 10:37:39

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
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
...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

[reply] [top]


    [»] Re: garbage in response
    by Patrick Lenz - Jul 13th 2004 11:02:21

    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?

    --
    It's all my fault!

    [reply] [top]


      [»] Re: garbage in response
      by martin klang - Jul 13th 2004 15:31:14


      > 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!

      [reply] [top]


        [»] Re: garbage in response
        by Patrick Lenz - Jul 13th 2004 22:54:15

        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.

        --
        It's all my fault!

        [reply] [top]


          [»] Re: garbage in response
          by Nate Nielsen - Oct 18th 2004 17:18:23


          > 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.

          [reply] [top]


    [»] Re: garbage in response
    by milky - Jul 24th 2004 17:37:11

    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.

    [reply] [top]


      [»] Re: garbage in response
      by martin klang - Aug 4th 2004 17:02:20

      Okay, thanks. I'll take your advice and RTFM.

      [reply] [top]


[»] Excessive authentication complication?
by flamingcow - Mar 14th 2004 15:18:45

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).

[reply] [top]


[»] only submission functions?
by Jonas - Mar 9th 2004 04:42:09

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.

[reply] [top]


    [»] Re: only submission functions?
    by Patrick Lenz - Mar 9th 2004 04:49:21


    > 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.

    --
    It's all my fault!

    [reply] [top]


      [»] Re: only submission functions?
      by Jonas - Mar 9th 2004 07:14:18

      Cool, that's exactly what I need. Whish I'd found it a little earlier though ;)

      [reply] [top]


[»] Apache Ant Task
by Carsten Frewert - Mar 6th 2004 06:09:31

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

[reply] [top]


    [»] Re: Apache Ant Task
    by jeff covey - Mar 6th 2004 08:53:01

    Sounds fun; thanks. :)

    --
    vs lbh pna ernq guvf, lbh'er n trrx.

    [reply] [top]


    [»] Re: Apache Ant Task
    by mike - May 10th 2004 19:26:09


    > As I didn't found any ant task for

    > submitting releases to freshmeat, I

    > decided to write one.

    How goes it?

    [reply] [top]


    [»] Re: Apache Ant Task
    by David Walker - Jun 22nd 2004 04:01:29


    > 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?

    --
    David Walker

    [reply] [top]


      [»] Re: Apache Ant Task
      by Carsten Frewert - Jul 12th 2004 05:35:52

      [...]

      > 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

      [reply] [top]


        [»] Re: Apache Ant Task
        by Carsten Frewert - Jul 13th 2004 02:43:33

        Well, here it is: http://www.frewert.de/archive/java/ant/antmeat-0.1.zip

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

        Have fun, Carsten

        [reply] [top]


          [»] Re: Broken link
          by Melvin - Apr 6th 2007 12:16:23


          > Well, here it is:
          > http://www.frewert.de/archive/java/ant/antmeat-0.1.zip
          >

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

          Mel

          [reply] [top]


            [»] Re: Broken link
            by Carsten Frewert - Aug 12th 2007 05:30:43


            >

            >% http://www.frewert.de/archive/java/ant/antmeat-0.1.zip

            >

            > 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 http://antmeat.sourceforge.net/

            Cheers
            Carsten

            [reply] [top]


[»] PHP class to use the Freshmeat.net xml-rpc interface
by Hatem - Feb 21st 2004 08:53:38

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 (http://www.phpclasses.org/browse/package/1506.html) and until that time you can email me to request this class "for free" of course : info at dynamix-tn dot com

Regards,
Hatem

[reply] [top]


    [»] Re: PHP class to use the Freshmeat.net xml-rpc interface
    by Hatem - Feb 23rd 2004 07:45:41

    Well you can download the class from here.

    Regards, Hatem

    [reply] [top]


    [»] Re: PHP class to use the Freshmeat.net xml-rpc interface
    by Wallace86 - Jun 22nd 2004 04:09:59


    > 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
    > (http://www.phpclasses.org/browse/package/1506.html)
    > and until that time you can email me
    > to request this class "for
    > free" of course : info at
    > dynamix-tn dot com
    >
    > Regards,
    > Hatem

    That's great.
    Thanks, Hatem.

    --
    Carl Wallace

    [reply] [top]


    [»] Re: PHP class to use the Freshmeat.net xml-rpc interface
    by iRude - Dec 14th 2004 00:44:54

    yes! I agree, My XML / RSS avail. here RSS iRude

    --
    My :2cents: are not Rude

    [reply] [top]


[»] Test mode needed?
by Brendan Macmillan - Dec 25th 2003 08:39:16

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 http://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

[reply] [top]


[»] License values?
by Norman Walsh - Dec 19th 2003 07:00:38

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.)

[reply] [top]


    [»] Re: License values?
    by Patrick Lenz - Dec 19th 2003 07:38:56


    > 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.


    > 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.

    --
    It's all my fault!

    [reply] [top]


[»] Security?
by Petr Kocmid - Dec 16th 2003 10:57:56

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?

--
That's it.

[reply] [top]


    [»] Re: Security?
    by Patrick Lenz - Dec 16th 2003 11:03:19


    > 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.

    --
    It's all my fault!

    [reply] [top]


    [»] Re: Security?
    by KinkyClown - Dec 17th 2003 00:01:37


    > 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.

    [reply] [top]


[»] Why not SOAP?
by Jerri - Dec 16th 2003 10:32:20

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!

--
cu --== Jerri ==-- Homepage: http://www.jerri.de/

[reply] [top]


    [»] Re: Why not SOAP?
    by Patrick Lenz - Dec 16th 2003 10:44:09


    > 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).

    --
    It's all my fault!

    [reply] [top]


    [»] Re: Why not SOAP?
    by Sergio - Dec 16th 2003 11:32:13

    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?

    --
    Sergio Carvalho

    [reply] [top]


    [»] Re: Why not SOAP?
    by ZB - Dec 16th 2003 14:50:10

    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('http://www.xmethods.net/sd/StockQuoteService.wsdl')
    -> getQuote('MSFT');

    That's it.

    [reply] [top]


[»] URL?
by RUok - Dec 16th 2003 08:46:35

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

[reply] [top]


    [»] Re: URL?
    by Patrick Lenz - Dec 16th 2003 08:52:38


    > What URL should client apps use to run
    > these methods? I tried
    > http://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.

    --
    It's all my fault!

    [reply] [top]


      [»] Re: URL?
      by John Newbigin - Jan 13th 2004 03:25:53

      What about an https url?

      [reply] [top]


        [»] Re: URL?
        by Buy Gifts - May 21st 2004 20:57:07


        > What about an https url?

        >

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

        --
        Digital Cameras - Biz

        [reply] [top]




© Copyright 2007 SourceForge, Inc., All Rights Reserved.
About freshmeat.net •  Privacy Statement •  Terms of Use •  Trademark Guidelines •  Advertise •  Contact Us • 
ThinkGeek •  Slashdot  •  ITMJ •  Linux.com •  NewsForge  •  SourceForge.net  •  Surveys •  Jobs •  PriceGrabber