Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

ftlabs/Listen-to-the-FT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Listen to the FT

An offline-enabled progressive web app for listening to the FT

As of 25 Jan 2018 this app has been switched off. It was rather nice though. Hopefully it will return.

Read the blog about the app

Summary

We were asked to explore whether or not FT subscribers would listen to FT content in a podcast and this is what we came up with:

start

Features

Offline-enabled

Using service workers, we were able to create a web app that would function offline.

offline

Progressively Enhanced

Listen to the FT works great on the web, but, with the inclusion of a manifest and a service workers, it can work even better in modern browsers/platforms. For example, on Android devices, Listen to the FT can be installed to the home screen and run fullscreen using the latest Chrome/Firefox/Samsung Internet browsers.

icon

Download audio content

The inclusion of a service worker also allowed us to to download content ahead of time, so it could be listened to when a network connection isn't readily available or reliable (like travelling on the Tube)

download

Enhanced media controls

Utilizing the newly available media session APIs, we were also able to offer more powerful media controls from the lock screen of Android devices.

controls

Build locally

install

npm install
npm update

configure

Set these env vars in the shell or in a .env file

  • AUDIO_ARTICLES_THING_ID=...
  • AUDIO_AVAILABLE_SERVICE=...
  • AUDIO_STATS_SERVICE=...
  • AWS_AUDIO_BUCKET=...
  • AWS_REGION=...
  • CAPI_KEY=...
  • DEBUG=*
  • FT_API_URL=...
  • MEMBERSHIP_LOGIN_API_KEY=...
  • MEMBERSHIP_SESSION_API_KEY=...
  • MYFT_API_KEY=...
  • MYFT_API_URL=...
  • RECORDED_MEDIA_FORMAT=mp3
  • UPP_COCO=...

run

npm run prestart
npm run start

and look for http://localhost:3000/