Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions edge-apps/rss-reader/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
*.log
.DS_Store
screenshots/*.png
2 changes: 1 addition & 1 deletion edge-apps/rss-reader/.ignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
screenly_qc.yml
node_modules/
93 changes: 25 additions & 68 deletions edge-apps/rss-reader/README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,52 @@
# RSS Reader Edge App
# RSS Reader

![RSS Reader Edge App Preview](./static/img/rss-app-preview.png)
Displays the latest entries from any RSS feed on your Screenly digital signage screens.

This Edge App displays articles from an RSS feed.
It uses [Alpine.js](https://alpinejs.dev/) for reactivity.

## Running the Edge App emulator

Before running the development server, run the following commands.
Doing so generates a file named `mock-data.yml`. Feel free to tweak the
YAML file as you see fit.
## Getting Started

```bash
$ cd edge-apps/rss-reader
$ screenly edge-app generate-mock-data
# A file named `mock-data.yml` will be created if it doesn't exist yet.
bun install
```

Start the emulator:

```bash
$ screenly edge-app run
# You'll get the following console output:
Edge app emulator is running at http://127.0.0.1:40069/edge/1/index.html
```

The port number (e.g., `40069`) changes everytime you run the command.
Hit `Ctrl-C` to close the server.

## Uploading
## Development

```bash
$ screenly edge-app create \
--name=my-rss-reader-app \
--in-place
$ screenly edge-app deploy
bun run dev
```

Install the app
## Testing

```bash
$ screenly edge-app instance create
Edge app instance successfully created.
bun test
```

Configure the feed:
## Build

```bash
$ screenly edge-app setting set rss_title=BBC
Edge app setting successfully set.

$ screenly edge-app setting set rss_url=http://feeds.bbci.co.uk/news/rss.xml
Edge app setting successfully set.
bun run build
```

In some instances, you need to bypass the CORS policy in order to retrieve news. To do this, we can use the built-in [CORS bypass](https://developer.screenly.io/edge-apps/#cors) in Edge Apps by setting:
## Deployment

```bash
$ screenly edge-app setting set bypass_cors=true
Edge app setting successfully set.
screenly edge-app create --name rss-reader --in-place
bun run deploy
screenly edge-app instance create
```

Here's a table that contains a list of some RSS feed URLs, and whether the CORS proxy should be bypassed or not.

| URL | Requires CORS | bypass_cors |
| ----------------------------------------------------- | ------------- | ----------- |
| `http://feeds.bbci.co.uk/news/rss.xml` | Yes | true |
| `https://lifehacker.com/rss` | Yes | true |
| `https://www.reddit.com/.rss` | Yes | true |
| `https://rss.nytimes.com/services/xml/rss/nyt/US.xml` | No | false |
| `http://rss.sciam.com/sciam/60secsciencepodcast` | Yes | true |

## Tweaking the time and locale settings

### `override_timezone`
## Configuration

For instance, if you want to set the RSS feed update date and time as per the current date and time in London,
| Setting | Description | Type | Default |
| ------------------- | -------------------------------------------------------------------- | -------- | -------------------------------------- |
| `bypass_cors` | Route the RSS feed URL through the CORS proxy | optional | `true` |
| `cache_interval` | How often (in seconds) to refresh the feed | required | `1800` |
| `override_locale` | Override the locale used for date formatting (e.g. `en`, `fr`, `de`) | optional | `en` |
| `override_timezone` | Override the timezone for date display (e.g. `Europe/London`) | optional | system timezone |
| `rss_title` | Source label shown on each card | required | `BBC News` |
| `rss_url` | URL of the RSS feed to display | required | `http://feeds.bbci.co.uk/news/rss.xml` |

run the following command after setting the timer:
## Screenshots

```bash
$ screenly edge-app setting set override_timezone='Europe/London'
# A relatively long console output...
Edge app setting successfully set.

$ screenly edge-app setting set override_locale='en-gb'
# A relatively long console output...
Edge app setting successfully set.
bun run screenshots
```

See [this page](https://momentjs.com/) for the list of all possible values for the time zone.
Alternatively, you can call `moment.locales()`, which returns all the supported locale values.

Setting invalid values for the timezone won't crash the app itself, it'll just fall back to the default time.
Loading