Skip to content

Commit

Permalink
🚀 Setup inicial do projeto
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasgusson committed Sep 18, 2023
0 parents commit 15eb16d
Show file tree
Hide file tree
Showing 18 changed files with 14,089 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI
on: [push]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint

- name: Test
run: yarn test --ci --coverage --maxWorkers=2

- name: Build
run: yarn build
12 changes: 12 additions & 0 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: size
on: [pull_request]
jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.log
.DS_Store
node_modules
dist
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Douglas Gusson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# afacinemas.js 🎥
> A web scraper library for [AFA Cinemas](http://www.afacinemas.com.br/)
[![npm version](https://badge.fury.io/js/afacinemas.svg)](https://badge.fury.io/js/afacinemas)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

```bash
npm install afacinemas
```

## Usage

### ES6

```javascript
import { getTheaters, getReleases } from "afacinemas";

Promise.all([getTheaters(), getReleases()]).then(([theaters, releases]) => {
console.log(theaters);
console.log(releases);
});
```

### CommonJS

```javascript
const { getTheaters, getReleases } = require("afacinemas");

Promise.all([getTheaters(), getReleases()]).then(([theaters, releases]) => {
console.log(theaters);
console.log(releases);
});
```

## API

### getTheaters()

Fetches the list of theaters.

```javascript
import { getTheaters } from "afacinemas";

getTheaters().then(theaters => {
console.log(theaters);
});
```

### getReleases()

Fetches the list of next releases.

```javascript
import { getReleases } from "afacinemas";

getReleases().then(releases => {
console.log(releases);
});
```

### getSessions(theaterId, sessionsDate)

Fetches the list of sessions for a given theater and date.

```javascript
import { getSessions } from "afacinemas";

getSessions(12, "2023-09-20").then(sessions => {
console.log(sessions);
});
```
Loading

0 comments on commit 15eb16d

Please sign in to comment.