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

https://github.com/notrab/gatsby-source-transistorfm

🎙 Gatsby source plugin for fetching show and episode data from Transistor
https://github.com/notrab/gatsby-source-transistorfm

Last synced: 7 months ago
JSON representation

🎙 Gatsby source plugin for fetching show and episode data from Transistor

Awesome Lists containing this project

README

        

# gatsby-source-transistorfm

🎙 Gatsby source plugin for fetching show and episode data from [Transistor](https://transistor.fm).

## Install

```bash
yarn add gatsby-source-transistorfm
```

## How to use

```js
// In your gatsby-config.js
plugins: [
{
resolve: 'gatsby-source-transistorfm',
options: {
url: '...',
},
},
];
```

To use multiple Transistor feeds, just add another instance of the plugin configuration to `gatsby-config.js`.

### Example

```js
// In your pages/*.js
import React from 'react';
import { graphql, useStaticQuery } from 'gatsby';
import Img from 'gatsby-image';
import ReactAudioPlayer from 'react-audio-player';

const pageQuery = graphql`
{
show: transistorShow {
id
title
description
episodes {
id
title
content
enclosure {
url
}
image {
childImageSharp {
fluid(maxWidth: 560) {
...GatsbyImageSharpFluid
}
}
}
}
image {
childImageSharp {
fluid(maxWidth: 560) {
...GatsbyImageSharpFluid
}
}
}
}
}
`;

const IndexPage = () => {
const { show } = useStaticQuery(pageQuery);

return (

{show.title}


{show.description}


{show.episodes.map(episode => (

{episode.title}


{episode.content}




))}

);
};

export default IndexPage;
```