Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: API available to connect to database with custom queries? #86220
    Perry
    Participant

    Best use case is a rest server. The rest sever would run on the same server as the database but would be separate from the website, but run on a different port. Then you would make a subdomain such as api.sailboatdata.com and point it at the server. Then you use virtual host in apache or whatever web server you are using and point all requests to that port. The rest server would take the http request, retrieve the data and return it in a JSON format, provided you sent it a correct request.

    That is asking a lot from the owner of this site even if you agree to build the rest server for him. What you can do is build a web scraper. You send an http request to his website, it spits back the html and then you parse through the html and get your data. For instance the http request sailboatdata.com/sailboat/ sends you to a page where you can specify what you are searching for. For example your search for SA/D between 18 and 21 would result in a long link which I will not put here because apparently I can not post more than 2 links as a new member.
    You could of course change the number in paginate to cut down on the number of links it returns. Then you would iterate through all those links, http request them and parse each web page for the information you need.

    Sounds like a fun project. Good luck!

    in reply to: API available to connect to database with custom queries? #86215
    Perry
    Participant

    API would be nice for this site. I built a membership application for a sailing club and would love it to fill in all the blanks when I put in a boat. A Spring Boot app which could dish out JSON could be built in a few hours. That said, this is a small database of 8000 or so boats. If you only need 20 or so boats you could web scrape it.

Viewing 2 posts - 1 through 2 (of 2 total)