Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nestarz/radio-zapping
Loop radio programmes and record parts using speaker and mic into wav files using Puppeteer
https://github.com/nestarz/radio-zapping
Last synced: about 1 month ago
JSON representation
Loop radio programmes and record parts using speaker and mic into wav files using Puppeteer
- Host: GitHub
- URL: https://github.com/nestarz/radio-zapping
- Owner: nestarz
- Created: 2020-01-19T21:40:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-05T19:37:38.000Z (over 3 years ago)
- Last Synced: 2024-11-22T00:51:40.786Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 23 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Radio Zapping
## Requirements
- Chromium
- https://github.com/RedKenrok/node-audiorecorder#dependencies## Installation
```
yarn install
```## Usage
```javascript
import path from "path";
import radioZapping from "./main.js";const f00 = (...args) => args.map(n => String(n).padStart(2, "0"));
const radios = [
{
name: "franceculture",
entrypoint: (year, month, day) =>
`https://www.franceculture.fr/archives/${year}/${f00(month)}/${f00(day)}`,
anchors: ".archives-by-day-list-element a",
playbtn: "button.replay-button"
},
{
name: "franceinter",
entrypoint: (year, month, day) =>
`https://www.franceinter.fr/archives/${year}/${f00(month)}-${f00(day)}`,
anchors: ".simple-list-element a",
playbtn:
".cover-emission-actions-buttons-wrapper button.replay-button.playable"
},
{
name: "francemusique",
entrypoint: (year, month, day) =>
`https://www.francemusique.fr/programmes/${year}-${f00(month)}-${f00(day)}`,
anchors: "a.step-list-element-content-editorial",
playbtn: ".cover-diffusion button.replay-button.playable"
}
];const randomArr = arr =>
arr[Math.floor(Math.random() * Object.keys(arr).length)];radioZapping(
[15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29].map(day => ({
year: 2019,
month: 8,
day,
n: 3,
duration: 20 * 1000 + 5000 * Math.random(),
radio: randomArr(radios)
})),
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
path.join(__dirname, "output2")
);
```