From 9534686d87b502275b9c551840d35cb746e2a5df Mon Sep 17 00:00:00 2001 From: Wenbin Fang Date: Tue, 27 Apr 2021 22:13:04 -0700 Subject: [PATCH] Initial commit --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- examples/Gemfile | 1 + examples/Gemfile.lock | 16 ++++++++++++++++ examples/sample.rb | 1 + lib/podcast_api.rb | 11 +++++++++++ lib/version.rb | 5 +++++ podcast_api.gemspec | 40 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 examples/Gemfile create mode 100644 examples/Gemfile.lock create mode 100644 examples/sample.rb create mode 100644 lib/podcast_api.rb create mode 100644 lib/version.rb create mode 100644 podcast_api.gemspec diff --git a/README.md b/README.md index 7231635..103f29f 100644 --- a/README.md +++ b/README.md @@ -1 +1,42 @@ -# podcast-api-ruby \ No newline at end of file +# Podcast API Ruby Library + +[![Build Status](https://travis-ci.com/ListenNotes/podcast-api-ruby.svg?branch=main)](https://travis-ci.com/ListenNotes/podcast-api-ruby) + +The Podcast API Ruby library provides convenient access to the [Listen Notes Podcast API](https://www.listennotes.com/api/) from +applications written in Ruby. + +Simple and no-nonsense podcast search & directory API. Search the meta data of all podcasts and episodes by people, places, or topics. + + + +## Documentation + +See the [Listen Notes Podcast API docs](https://www.listennotes.com/api/docs/). + + +## Installation + +Install the package with: +```sh +gem install podcast-api +``` + + +### Requirements + +- Ruby 2.3+ + +## Usage + +The library needs to be configured with your account's API key which is +available in your [Listen API Dashboard](https://www.listennotes.com/api/dashboard/#apps). Set `apiKey` to its +value: + +```ruby + +# TODO +``` + +If `apiKey` is null, then we'll connect to a [mock server](https://www.listennotes.com/api/tutorials/#faq0) that returns fake data for testing purposes. + +You can see all available API endpoints and parameters on the API Docs page at [listennotes.com/api/docs/](https://www.listennotes.com/api/docs/). diff --git a/examples/Gemfile b/examples/Gemfile new file mode 100644 index 0000000..a08c364 --- /dev/null +++ b/examples/Gemfile @@ -0,0 +1 @@ +gem "podcast_api", path: "../" diff --git a/examples/Gemfile.lock b/examples/Gemfile.lock new file mode 100644 index 0000000..033ac0c --- /dev/null +++ b/examples/Gemfile.lock @@ -0,0 +1,16 @@ +PATH + remote: .. + specs: + podcast_api (1.0.1) + +GEM + specs: + +PLATFORMS + ruby + +DEPENDENCIES + podcast_api! + +BUNDLED WITH + 1.17.2 diff --git a/examples/sample.rb b/examples/sample.rb new file mode 100644 index 0000000..c55d21f --- /dev/null +++ b/examples/sample.rb @@ -0,0 +1 @@ +require "podcast_api" diff --git a/lib/podcast_api.rb b/lib/podcast_api.rb new file mode 100644 index 0000000..23b90dd --- /dev/null +++ b/lib/podcast_api.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require "net/http" + +# Version +require "version" + +puts PodcastApi::VERSION + +module PodcastApi +end diff --git a/lib/version.rb b/lib/version.rb new file mode 100644 index 0000000..ac71eeb --- /dev/null +++ b/lib/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module PodcastApi + VERSION = "1.0.1" +end \ No newline at end of file diff --git a/podcast_api.gemspec b/podcast_api.gemspec new file mode 100644 index 0000000..4f734c8 --- /dev/null +++ b/podcast_api.gemspec @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +$LOAD_PATH.unshift(::File.join(::File.dirname(__FILE__), "lib")) + +require "version" + +Gem::Specification.new do |s| + s.name = "podcast_api" + s.version = PodcastApi::VERSION + s.required_ruby_version = ">= 2.3.0" + s.summary = "Ruby bindings for the Listen Notes Podcast API" + s.description = "Listen Notes is the best podcast search engine and api. " \ + "See https://www.listennotes.com/api/ for details." + s.author = "Listen Notes, Inc." + s.email = "hello@listennotes.com" + s.homepage = "https://www.listennotes.com/api/" + s.license = "MIT" + + s.metadata = { + "bug_tracker_uri" => "https://github.com/ListenNotes/podcast-api-ruby/issues", + "changelog_uri" => + "https://github.com/ListenNotes/podcast-api-ruby/releases", + "documentation_uri" => "https://www.listennotes.com/api/docs/", + "github_repo" => "https://github.com/ListenNotes/podcast-api-ruby", + "homepage_uri" => "https://www.listennotes.com/api/", + "source_code_uri" => "https://github.com/ListenNotes/podcast-api-ruby", + } + + ignored = Regexp.union( + /\A\.editorconfig/, + /\A\.git/, + /\A\.rubocop/, + /\A\.travis.yml/, + /\Atest/ + ) + s.files = `git ls-files`.split("\n").reject { |f| ignored.match(f) } + s.executables = `git ls-files -- bin/*`.split("\n") + .map { |f| ::File.basename(f) } + s.require_paths = ["lib"] +end