npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fukuoka-city-community-space-finder

v0.1.0

Published

Find Community Spaces in Fukuoka City and check reservation status of them.

Downloads

6

Readme

Fukuoka City Community Space Finder

MIT License npm version Code Climate Japanese

Find Community Spaces in Fukuoka City and check reservation status of them. If you want to try it as a stand-alone command, see Running as a stand-alone command section.

Install

$ npm install fukuoka-city-community-space-finder

Usage

This library provides four methods; area, building, institution, and status. The former three methods are for finding community spaces. Fukuoka City is separated into several area. area returns such area names. Each area has some buildings, such community centre, sports centre, etc. building returns those buildings in a given area.

var finder = require("fukuoka-city-community-space-finder");

// Find areas.
finder.area().then(function(res){
  console.log(res);
});
// -> [ '中央区', '博多区', '東区', '西区', '南区', '城南区', '早良区' ]

// Find buildings in an area.
finder.building("中央区").then(function(res) {
  console.log(res);
});
// -> [ '舞鶴公園', '平和中央公園', '中央体育館', '市民会館',
//      '福岡市文学館(赤煉瓦文化館)', '健康づくりサポートセンター',
//      'NPOボランティア交流センター', '中央市民センター' ]

// Find institutions in a building (space).
finder.institution("中央区", "舞鶴公園").then(function(res) {
  console.log(res);
});
// -> [ '野球場', 'テニスコート1', '球技場' ]

The last method status checks reservation status of an institution in a week, which means checking the institution is already occupied, available, or in maintenance, etc.

var finder = require("fukuoka-city-community-space-finder");

finder.status("中央区", "舞鶴公園", "野球場", 2016, 4, 25).then(
  function(res) {
    console.log(JSON.stringify(res));
  }
);

The output of status method is an object and the result of the above sample is as follows.

{
  "04/25(月)": {
    "600": "closed",
    "900": "available",
    "1100": "available",
    "1300": "available",
    "1500": "occupied",
    "1700": "occupied"
  },
  ...
}

However, there is another type of results for complex institutions. For example, if you ask as

var finder = require("fukuoka-city-community-space-finder");

finder.status("中央区", "舞鶴公園", "テニスコート1", 2016, 4, 25).then(
  function(res) {
    console.log(JSON.stringify(res));
  }
);

you will receive the following result.

{
  "テニスコート1": {
    "04/25(月)": {
      "06:00-19:00": "available"
    },
    ...
  },
  "テニスコート2": {
    "04/25(月)": {
      "06:00-10:00": "available",
      "10:00-12:00": "occupied",
      "12:00-19:00": "available"
    },
    ...
  },
  ...
}

Method

area()

Returns a list of areas in Fukuoka city.

Returns

A Promise object which returns a list of areas in Fukuoka city.

building(area)

Returns a list of buildings in a given area.

Args

  • area: name of the area.

Returns

A Promise object which returns a list of buildings in the area.

institution(area, building)

Returns a list of institutions in a given area and building.

Args

  • area: name of the area.
  • building: name of the building.

Returns

A Promise object which returns a list of institutions.

status(area, building, institution, year, month, day)

Search reservation statuses of a given institution in a given date.

Args

  • area: area name obtained by area method.
  • building: building name obtained by building method.
  • institution: institution name obtained by institution method.
  • year: Year.
  • month: Month.
  • day: Day.

Returns

A Promise object hich returns the result via then method.

Error

Sometimes some error happens, in most of cases it is because of internet speed or server's traffic. At first, you should try again.

Running as a stand-alone command

This module provides csf command for stand-alone running. To install the command globally, run

$ npm install -g fukuoka-city-community-space-finder

now you can use csf command.

Usage: csf <command> [options]

Commands:
  area         List up areas.
  building     List up buildings in an area.
  institution  List up institutions in a building
  state        Search reservation status.

Options:
  --help  Show help                                                    [boolean]

Each command is related to same name function.

area

Show the list of areas.

csf area

Options:
  --help  Show help                                                    [boolean]

building

Show a list of buildings in an area.

csf building

Options:
  --help  Show help                                                    [boolean]
  --area  Name of area.

institution

Show a list of institutions in a building.

csf institution

Options:
  --help      Show help                                                [boolean]
  --area      Name of area.                                           [required]
  --building  Name of building.                                       [required]

state

Search reservation status.

csf state

Options:
  --help         Show help                                             [boolean]
  --area         Name of area.                                        [required]
  --building     Name of building.                                    [required]
  --institution  Name of institution.                                 [required]
  --year         Year.                                          [default: today]
  --month        Month.                                         [default: today]
  --day          Day.                                           [default: today]

License

This software is released under the MIT License, see LICENSE.

Acknowledgement

This project is partly supported by BigData & OpenData Initiative in Kyushu.