Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentraland-scenes/Party-Time
Use a time API to get the current time and start a party
https://github.com/decentraland-scenes/Party-Time
decentraland
Last synced: about 1 month ago
JSON representation
Use a time API to get the current time and start a party
- Host: GitHub
- URL: https://github.com/decentraland-scenes/Party-Time
- Owner: decentraland-scenes
- License: apache-2.0
- Created: 2020-05-29T19:24:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-25T20:12:40.000Z (over 2 years ago)
- Last Synced: 2024-05-02T17:52:52.160Z (8 months ago)
- Topics: decentraland
- Language: TypeScript
- Homepage:
- Size: 3.23 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Repository - Party Time - time.png" width="200"> | Hit a world clock API to check the time, start a party if it's after 9PM. | (Examples / Multiplayer and APIs)
README
# Party time
This simple scene calls a time API to fetch the current time. If the time is between 9:00 PM and midnight in GMT+3, a party starts.
![](screenshot/screenshot.png)
This scene shows you:
- How to send requests to an API
- How to parse a JSON response
- How to handle async functions, waiting for an external response
- How to stream audio
- How to stream video, and display it as a texture on primitive shapesThe RESTful API called is `https://worldtimeapi.org/api`, which returns a JSON file with several fields that can be read.
## Try it out
**Install the CLI**
Download and install the Decentraland CLI by running the following command:
```bash
npm i -g decentraland
```**Previewing the scene**
Download this example and navigate to its directory, then run:
```
$: dcl start
```Any dependencies are installed and then the CLI opens the scene in a new browser tab.
**Scene Usage**
Once the party starts, the scene starts streaming audio from an internet radio, and applies video textures from a video stream to spinning cubes.
Learn more about how to build your own scenes in our [documentation](https://docs.decentraland.org/) site.
If something doesn’t work, please [file an issue](https://github.com/decentraland-scenes/Awesome-Repository/issues/new).
## Copyright info
This scene is protected with a standard Apache 2 licence. See the terms and conditions in the [LICENSE](/LICENSE) file.