Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mrloop/strava_onebox

Strava Onebox for embeding strava rides
https://github.com/mrloop/strava_onebox

Last synced: 5 days ago
JSON representation

Strava Onebox for embeding strava rides

Awesome Lists containing this project

README

        

# Strava Onebox

[![CI](https://github.com/mrloop/strava_onebox/actions/workflows/ci.yml/badge.svg)](https://github.com/mrloop/strava_onebox/actions/workflows/ci.yml)

[Strava](https://www.strava.com/) [Onebox](https://github.com/discourse/onebox) for embedding strava activities in [Discourse](discourse.org)

Example at http://elgin.cc/t/australian-pursuit-race/66/2

### Supported URLs for embeds

You need to use a url from the 'Embed on Blog' code

- http://www.strava.com/activities/190948728/embed/7dc1376fba9ec275bf3b41a2df3d423ed2f5c6ae

Or 'Share your rides' from your profile

- https://www.strava.com/athletes/150922/latest-rides/9debf6ca6f225aa2f987ca2f99b416d78f6b0f49
- https://www.strava.com/athletes/150922/activity-summary/9debf6ca6f225aa2f987ca2f99b416d78f6b0f49

### Allowed iframes

Update the 'allowed iframes' in the security settings of your site to include 'https://www.strava.com/'.

## Installation

```sh
cd /var/discourse
nano containers/app.yml
```

```yml

hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/mrloop/strava_onebox.git

```

* Rebuild the container and restart the application

```sh

cd /var/discourse
./launcher rebuild app
./launcher restart app

```

### Update existing posts

```sh

./launcher enter app
cd /var/www/discourse
rake posts:refresh_oneboxes

```

## To run tests

```sh

ruby -Ilib:test plugin_test.rb

```