Request for comments: port-tags

Anton Berezin tobez at freebsd.org
Tue Nov 8 02:33:38 PST 2005


On Tue, Nov 08, 2005 at 11:51:00AM +0200, Panagiotis Astithas wrote:

> If you keep maintaining the web site, it would be a good idea to
> provide some sort of web-service protocol in order to be used from
> client applications. It could be something as simple as querying by
> adding the terms in the http path info and returning a document with a
> list of port names (newline-separated, comma-separated or whatever).
> Perhaps it will be easy to add this functionality to sysutils/bpm or
> sysutils/portbrowser.

Yes, some sort of API would be useful.

I just added the following:

If you add a m=pl ("mode = portlist") parameter to the URL,
it will return a newline separated list of matching ports:

	http://bsd2.be/port-tags/index.cgi/devel+mail?m=pl

For performance reasons, I limit the number of returned ports to 200 by
default.

So that

	http://bsd2.be/port-tags/index.cgi/japanese?m=pl

will return

	E(too many)[433]

instead of all 433 ports.  This can be overridden like this:

	http://bsd2.be/port-tags/index.cgi/japanese?m=pl&n=450

The same goes for tag-less queries:

	http://bsd2.be/port-tags/index.cgi/?m=pl

will produce

	E(too many)[13598]

But if you feel really adventurous,

	http://bsd2.be/port-tags/index.cgi/?m=pl&n=60000

will return all 13598 ports.  Please note that "n" parameter does not
specify how many ports to return, it specifies the upper limit only, so
if that is exceeded, "E(too many)" is returned.

I hope this is useful enough - and the good part is that we can always
extend it further if we have good ideas.  :-)

Cheers,
\Anton.
-- 
An undefined problem has an infinite number of solutions.
-- Robert A. Humphrey


More information about the freebsd-ports mailing list