Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentraland-scenes/Events-API
Call the Decentraland Events API to display events that are currently going on
https://github.com/decentraland-scenes/Events-API
decentraland
Last synced: about 1 month ago
JSON representation
Call the Decentraland Events API to display events that are currently going on
- Host: GitHub
- URL: https://github.com/decentraland-scenes/Events-API
- Owner: decentraland-scenes
- License: apache-2.0
- Created: 2020-06-16T22:00:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-24T21:21:04.000Z (over 2 years ago)
- Last Synced: 2024-05-02T17:52:51.795Z (8 months ago)
- Topics: decentraland
- Language: TypeScript
- Homepage:
- Size: 3.9 MB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Repository - Events API
README
# Events API Board
Call the Decentraland Events API to display events that are currently going on. If there are several active at the same time, it will cycle through up to 5 events.
This scene shows you:
- How to call the Decentraland Events API
- How to handle async functions that require waiting for a response
- How to parse a JSON response from an API
- How to parse incoming text fields so that they adjust to line width and a maximum length
- How to use a system to shuffle through different in-world UI screens
- How to use a teleport to travel to other locations in DecentralandEvents that are currently going on have a `live` field = _true_, so it's easy to filter through the returned events to only pick those that are live.
The board displays the event's title, screenshot, location, and location name (if applicable). The board also works as a teleport when clicked, taking players to the currently displayed event.
## About the events API:
Root URL: https://events.decentraland.org/api/events/
Events are always ordered by their `start_at` time
optional params:
- limit: only show x amount of events
- offset: start showing events from x position onwards
- position: a single event on x position
- estate_id: only events that happen in a given estate
- user: only events created by a given user
- onlyUpcoming: only events that have not started yet## 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**
If there are no live events right now, you won't see the board when running the preview. If there are several live events, they will be shuffled through every few seconds, or you can also click on the dots on the bottom of the board to switch through them manually.
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.