https://github.com/listennotes/listennotes-chatgpt-plugin
Listen Notes ChatGPT Plugin for AI-powered podcast search. Powered by PodcastAPI.com and Cloudflare Pages.
https://github.com/listennotes/listennotes-chatgpt-plugin
chatgpt chatgpt-plugins listennotes podcast-api podcast-database podcast-search
Last synced: 5 months ago
JSON representation
Listen Notes ChatGPT Plugin for AI-powered podcast search. Powered by PodcastAPI.com and Cloudflare Pages.
- Host: GitHub
- URL: https://github.com/listennotes/listennotes-chatgpt-plugin
- Owner: ListenNotes
- License: agpl-3.0
- Created: 2023-06-14T15:12:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T19:01:35.000Z (over 1 year ago)
- Last Synced: 2024-08-02T01:20:01.552Z (9 months ago)
- Topics: chatgpt, chatgpt-plugins, listennotes, podcast-api, podcast-database, podcast-search
- Language: JavaScript
- Homepage: https://ai.listennotes.com
- Size: 267 KB
- Stars: 22
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ChatGPT-repositories - listennotes-chatgpt-plugin - Listen Notes ChatGPT Plugin for AI-powered podcast search. Powered by PodcastAPI.com and Cloudflare Pages. (Browser-extensions)
README
# Listen Notes ChatGPT Plugin
This repository contains the source code for the Listen Notes ChatGPT plugin. This plugin is built with [PodcastAPI.com](https://www.podcastapi.com/) and deployed on serverless Cloudflare Pages using JavaScript. It allows users to interact with the Listen Notes Podcast Database through the ChatGPT interface. Users can search for podcasts, find episodes, get recommendations, and more.
## Table of Contents
- [Using the Plugin](#using-the-plugin)
- [Running Locally](#running-locally)
- [Deploying to Production](#deploying-to-production)
- [Adapting the Plugin](#adapting-the-plugin)## Using the Plugin
To use the Listen Notes ChatGPT plugin, you'll need to enable the plugin on [chat.openai.com](https://chat.openai.com/) first:
You can try prompts like these:
* "what are some recent podcast episodes talking about Sam Altman, in English"
* "give me a random podcast episode to listen"
* "how many episodes does the daily podcast have"
* "有哪些好的中文播客,关于犯罪的"
* "find me some podcasts about charles manson"
## Running Locally
To run this repo on your local development environment, follow these steps:
**0) Install [Cloudflare Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/)**
```
npm install -g wrangler
```**1) Clone the repository to your local machine.**
```
git clone https://github.com/ListenNotes/listennotes-chatgpt-plugin.git
```**2) Install the necessary dependencies.**
```
yarn install
```**3) Create a `.dev.vars` file in the root directory of this project (at the same level as package.json).**
Put these variables in the `.dev.vars` file:
```
LISTEN_API_KEY = "your_podcast_api_key_from_podcastapi.com"CHATGPT_SECRET = "your_custom_secret_which_is_like_a_password"
CHATGPT_VERIFICATION_TOKEN = "a_secret_generated_on_chat.openai.com"
NODE_VERSION = '17'
```|Variables|Description|Required for dev?|
|---------|-----------|-----------------|
|LISTEN_API_KEY| API key for Podcast API, which can be obtained at [listennotes.com/api/pricing](https://www.listennotes.com/api/pricing/)| Yes|
|CHATGPT_SECRET| A custom secret for interacting with proxy endpoints defined in [functions/api/v2](./functions/api/v2)| Yes|
|CHATGPT_VERIFICATION_TOKEN| A verification token generated on chat.openai.com. For dev purposes, you can put a random string or leave it blank for now.| No|
|NODE_VERSION| Pin the nodejs version to 17.0, which is to make Cloudflare Pages happy. | No|**4) Test the proxy endpoints**
Run the dev server first:
```
yarn dev
```Then use curl to send a request (Note: Replace $CHATGPT_SECRET with the value that you set in the `.dev.vars` file):
```
curl -X GET --location "http://localhost:8788/api/v2/search_podcasts?q=nba" \
-H "Authorization: Bearer $CHATGPT_SECRET"
```## Adapting the Plugin
This plugin can be adapted to work with other APIs. To do this, you'll need to modify the endpoints and the corresponding functions in the code.
Specifically, you'll need to change three things:
1) **Update [ai-plugin.json](./functions/.well-known/ai-plugin.json/index.js)**: Learn more on [openai.com](https://platform.openai.com/docs/plugins/getting-started/plugin-manifest).
2) **Update [proxy endpoints](./functions/api/v2) with other APIs**: Those proxy endpoints are running on Cloudflare Pages edge to send API requests. You may want to learn [how Cloudflare Pages functions work](https://developers.cloudflare.com/pages/platform/functions/get-started/) first.
3) **Update [openapi.json](./functions/chatgpt-plugin/openapi.json/index.js)**: ChatGPT relies on this openapi spec to know what proxy endpoints are available. You may want to learn more on [openai.com](https://platform.openai.com/docs/plugins/getting-started/openapi-definition).
### Deploying to Production
To deploy the Listen Notes ChatGPT plugin to production on [Cloudflare Pages](https://pages.cloudflare.com/), follow these steps:
1) **[Create a Cloudflare Pages project](https://dash.cloudflare.com/sign-up/workers-and-pages)**
You'll setup deployment configuration like this:
And setup environment variables:
Note: At first, you may just put a random string for CHATGPT_VERIFICATION_TOKEN because you'll get the real verification token later from openapi.com.
And setup custom domain for your Cloudflare Pages project:
2) **[Test on chat.openai.com](https://chat.openai.com/)**
Go to the Plugin store:
And follow the instructions to setup your plugin:
You'll see the verification token, then go back to the Cloudflare Pages dashboard to setup the value of CHATGPT_VERIFICATION_TOKEN (you can delete the old variable and add a new one):
To make your Cloudflare Pages project pick up the new CHATGPT_VERIFICATION_TOKEN value, you'll have to redeploy:
Then go back to the ChatGPT UI to verify the verification token.
By this point, you should be able to test your plugin on chat.openai.com.
### Submit for review
To list your plugin on the Plugin Store, please refer to the guidelines provided on [this page](https://platform.openai.com/docs/plugins/review) for submitting your plugin for review.