Grab BSD port summary from FreshPorts

Log in to Vote
5
5 Votes • 21 Comments
This would allow you to enter a query like such:

`bsd git` --> and some summary information from Freshports will be returned, such as:

"Git is a free and open source distributed version control system designed to
handle everything from small to very large projects with speed and efficiency.

WWW: http://git-scm.com/

To install the port: cd /usr/ports/devel/git/ && make install clean"

Would this be something people are interested in?
Source:
http://www.freshports.org/ -- not sure if they have a public api, so I am curious to know if there are other sources that could provide us the same information.
• posted 4 years and 9 months ago • type: Spice (API calls) Needs a Developer

zac
I think a lot of people would be interested in it :) When they serendipitously find it during a search, it will be like magic before their eyes!
posted by zac Staff4 years and 9 months ago Link
JulianGindi
My thoughts exactly :) Now I just need to find a public API somewhere and I can begin hacking this together
posted by JulianGindi 4 years and 9 months ago Link
dvl
FreshPorts is my website. Julian and I are discussing this via Twitter.
posted by dvl 4 years and 9 months ago Link
dvl
I think we need a new host for this, specifically for just this type of operation. www.freshports.org is for users. I want to put other stuff elsewhere. But of course, the hard part is naming the host. We'll figure that out later. Do you want to do this via http? Like you said on twitter: /ports?name=git

I think I want to handle that via rewrite, and caching. Lots of caching.

Let's try to design the server with future uses in mind.

Perhaps /ports/summary/?name=git&descr
posted by dvl 4 years and 9 months ago Link
JulianGindi
Good idea...that sounds good to me. What do you need from me to get started?
posted by JulianGindi 4 years and 9 months ago Link
dvl
Hmmm, have a read of recent tweets for better API design ideas.

First thing for me: create a new host and at least give you some stubs to work against. That won't get done today. Perhaps over the weekend, if time permits.

In the meantime, show me what you want returned for a the simple search request. That way, I have something for the stub which meets your expectations.
posted by dvl 4 years and 9 months ago Link
dvl
Welcome to the FreshPorts API server. It has no content yet, but that will come.

https://api.freshports.org/
http://api.freshports.org/

I think I will prefer https connections...

I'm also considering authentication of some type, to deter abuse.
posted by dvl 4 years and 9 months ago Link
dvl
Suggestions based on conversation with Tom Judge via Twitter.

what about:
/api/1/search/ports/name=git
/api/1/repo/ports/cat/port/
/api/1/repo/branches/cat/port
/api/1/repo/src

/api/1/repo/branch/name/cat/port
/api/1/repo/head/cat/port

and:

you could collapse branch/name and head into /head|<branch_name>/
posted by dvl 4 years and 9 months ago Link
dvl
Julian: how does this integrate with DuckDuckGo?
posted by dvl 4 years and 9 months ago Link
JulianGindi
Basically I would write a simple perl script that listens for a specific input and than makes a request with some params, I will than parse the return value and print it in a "pretty" format. I can start working on that whenever we have the API ready.
posted by JulianGindi 4 years and 9 months ago Link
dvl
Where does that perl script live?

As for the API, I'm still preoccupied with conference prep... getting the service host up might have been the easy part. :/
posted by dvl 4 years and 9 months ago Link
JulianGindi
I would make a fork of this repository: https://github.com/duckduckgo/zeroclicki... and add the new script. It would than live on the DuckDuckGo servers
posted by JulianGindi 4 years and 9 months ago Link
dvl
This isn't dead. It's a matter of timing.
posted by dvl 4 years and 4 months ago Link
Jag
This is exciting! Hope the API goes live!
posted by Jag Staff4 years and 1 month ago Link
This comment has been removed for violation of our forum rules.
posted by <hidden> • 4 years and 9 months ago
dvl
A few weeks ago, the source code for the website was released to GitHub: https://github.com/FreshPorts/freshports

A new issue was raised which reminded me of this API work: https://github.com/FreshPorts/freshports...

I have created an issue which mirrors this Instant Answer Idea: https://github.com/FreshPorts/freshports...


posted by dvl 3 years and 2 months ago Link
dvl
FreshPorts now uses a rewrite for most of the website. This is the change which will ease the creation of the API. I'm working on one other issue before playing with an API.
posted by dvl 3 years and 1 month ago Link
dvl
Can anyone recommend a PHP-based library I can start with? I'd rather not build a library for parsing API requests.
posted by dvl 3 years and 1 month ago Link
anonymous
There was a minor commit to the FreshPorts tree this morning. Still much more work to be done, but the first step to a hook is in there.

See line 84: https://github.com/FreshPorts/freshports...
posted by <hidden> • 2 years and 1 month ago Link
dvl
I'll be working on the api during a flight tomorrow.

I will implement this first:

/--/api/search/package?name=foo will return packages named foo (should be only one)

/--/api/search/port?name=foo will return list of ports named foo regardless of category


posted by dvl 2 years and 1 month ago Link
dvl
Are result such as this any use?

http://fp.local/--/api/1/search/package?...
{
"status": 200,
"data": "[{\"category\":\"sysutils\",\"name\":\"bacula-server\"}]"
}

http://fp.local/--/api/1/search/package?...
{
"status": 200,
"data": null
}
posted by dvl 2 years and 1 month ago Link