[freshports-coders] interface to query freshports' database

Dan Langille dan at langille.org
Wed Feb 24 00:53:59 GMT 2010


On 2/23/2010 12:02 PM, Mario G. Pavlov wrote:
> On Tuesday 23 February 2010 17:58:03 Dan Langille wrote:
>> On Tue, February 23, 2010 1:15 am, Mario G. Pavlov wrote:
>>> On Tuesday 23 February 2010 04:22:45 Dan Langille wrote:
>>>> On 2/21/2010 5:17 PM, Mario G. Pavlov wrote:
>>>>> Hi,
>>>>> as I'm not the only person (anymore) wanting something like that I'm
>>>>> starting this thread as Dan suggested. So why doesn't freshports
>>>>
>>>> provide
>>>>
>>>>> a way for external applications or in other words non-browser clients
>>>>
>>>> use
>>>>
>>>>> freshports' database? Maybe there was no demand until now?
>>>>
>>>> Correct.
>>>>
>>>>> Anyway I've spoken to Dan
>>>>> sometime ago for such an interface. I would imagine it something like
>>>>> that: sending an HTTP GET request to freshports with maybe SQL-like
>>>>
>>>> (or
>>>>
>>>>> whatever is better) parameters and freshports returning clear text (to
>>>>> save bandwidth) or XML (to be more elegant) with the response
>>>>> e.g.
>>>>> HTTP GET:
>>>>> www.freshports.org/publicAPI?ports=www\firefox,www\apache22&attributes
>>>>> =ve rsion,description RESPONSE (in clear text):
>>>>> www\firefox: version=3.5.7 description=web browser created by Mozilla
>>>>> www\apache22: version=2.2.6 description=widely used HTTP web server
>>>>>
>>>>> RESPONSE (in XML):
>>>>> <ports>
>>>>> 	<port name="www\firefox" version="3.5.7">
>>>>> 		<description>web browser created by Mozilla</description>
>>>>> 	</port>
>>>>> 	<port name="www\apache22" version="2.2.6">
>>>>> 		<description>widely used HTTP web server</description>
>>>>> 	</port>
>>>>> </ports>
>>>>>
>>>>> ...or something...
>>>>>
>>>>> Of course this is just a stupid example...the real thing would need
>>>>
>>>> some
>>>>
>>>>> design work.
>>>>> So Dan, what do you think? Are you into something like that?
>>>>
>>>> It's a matter of time.  In the immediate future, I have BSDCan and PGCOn
>>>> until the end of May.  After that, I can consider such things.  But the
>>>> design etc can start.
>>>>
>>>> A good place to start is the list of information you want from the
>>>> system.
>>>
>>> Hi Dan,
>>> I think the most important information would be the following:
>>> port name
>>> full port version
>>> short description (COMMENT)
>>> long description (pkg-descr)
>>> link to freshports.org
>>
>> That sounds similar to what's in the news feeds. Are they close to what
>> you need?
>>
>>> Another thing that we should consider is the limitations of URL when
>>> using HTTP GET. If I request information for 50-100 or more ports I will
>>> probably
>>> hit the URL length limit. Perhaps we should go for HTTP POST...or even
>>> another
>>> protocol (not HTTP). What do you think?
>>
>> What are you plans for this data retrieved from FreshPorts?
 > Hi Dan,
 > no, it's totally different than the news feeds. News (or whatever) 
feed is
 > data that your site/app decides to give its clients whereas the thing 
we want
 > is the opposite - your clients request the data they want.

I understand the mechanism is different, but some of the data content is 
similar.

 > I, in particular, will use FreshPorts' data for my little app -
 > http://www.freshports.org/ports-mgmt/portrac/

How do you obtain this information now?

-- 
Dan Langille - http://langille.org/


More information about the freshports-coders mailing list