[freshports-coders] interface to query freshports' database

Mario G. Pavlov mgp at e-soul.org
Wed Feb 24 05:55:05 GMT 2010


On Wednesday 24 February 2010 02:53:59 Dan Langille wrote:
> 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&attribute
> >>>>>s =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.
similar maybe but not necessarily
imagine you have 2 installed ports on your system and you want daily checks if 
your ports have updates...so you have to check only for your particular ports 
and the news feed, which is information only for the latest updates has no 
value to you...it will rarely provide the data you need
> 
>  > 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?
> 
currently I use http://www.freebsd.org/ports/INDEX-8.bz2 to obtain the 
information I need...however this is sometimes unreliable, the INDEX file 
could be out of date...and of course this is not optimal because normally a 
desktop system has 500-1000 ports installed and I need the information only 
for the installed ports but I get information for all 20000+ ports and I have 
to process all of it


More information about the freshports-coders mailing list