buzzsprout 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -3
- data/VERSION +1 -1
- data/buzzsprout.gemspec +79 -0
- data/changelog.md +2 -0
- data/lib/buzzsprout.rb +9 -4
- data/lib/buzzsprout/client.rb +9 -0
- data/test/test_buzzsprout.rb +8 -0
- metadata +5 -3
data/README.md
CHANGED
@@ -11,19 +11,23 @@ Ruby wrapper for the (yet unreleased, undocumented) [Buzzsprout](http://buzzspro
|
|
11
11
|
Getting a list of episodes
|
12
12
|
|
13
13
|
# get your podcast ID from your RSS feed http://www.buzzsprout.com/105.rss
|
14
|
-
|
14
|
+
Buzzsprout.episodes(105)
|
15
15
|
=> [<#Buzzsprout::Episode artist="Adam Stacoviak and Wynn Netherland" created_at=Mon Jan 25 11:53:02 -0600 2010 date=Mon, 25 Jan 2010 description="Adam and Wynn talk with Chris Wanstrath aka @defunkt from GitHub about the magic of Git, the past, present and future of GitHub, building a bootstrapped startup and some other cool stuff you'll just have to hear for yourself." duration=4675 id=2274 live=true podcast_id=105 s3=true size=37400482 tags="git, github, interview, bootstrapping, business, startups" title="Episode 0.1.0 - Chris Wanstrath from GitHub" updated_at=Mon Jan 25 13:36:42 -0600 2010>]
|
16
16
|
|
17
17
|
|
18
18
|
Get a list of tagged episodes
|
19
19
|
>> tags = %w(git github)
|
20
|
-
|
20
|
+
Buzzsprout.episodes(105, tags)
|
21
21
|
=> [<#Buzzsprout::Episode artist="Adam Stacoviak and Wynn Netherland" created_at=Mon Jan 25 11:53:02 -0600 2010 date=Mon, 25 Jan 2010 description="Adam and Wynn talk with Chris Wanstrath aka @defunkt from GitHub about the magic of Git, the past, present and future of GitHub, building a bootstrapped startup and some other cool stuff you'll just have to hear for yourself." duration=4675 id=2274 live=true podcast_id=105 s3=true size=37400482 tags="git, github, interview, bootstrapping, business, startups" title="Episode 0.1.0 - Chris Wanstrath from GitHub" updated_at=Mon Jan 25 13:36:42 -0600 2010>]
|
22
22
|
|
23
23
|
Get a single episode
|
24
24
|
# podcast_id, episode_id
|
25
|
-
|
25
|
+
Buzzsprout.episodes(105, 2274)
|
26
26
|
=> <#Buzzsprout::Episode artist="Adam Stacoviak and Wynn Netherland" created_at=Mon Jan 25 11:53:02 -0600 2010 date=Mon, 25 Jan 2010 description="Adam and Wynn talk with Chris Wanstrath aka @defunkt from GitHub about the magic of Git, the past, present and future of GitHub, building a bootstrapped startup and some other cool stuff you'll just have to hear for yourself." duration=4675 id=2274 live=true podcast_id=105 s3=true size=37400482 tags="git, github, interview, bootstrapping, business, startups" title="Episode 0.1.0 - Chris Wanstrath from GitHub" updated_at=Mon Jan 25 13:36:42 -0600 2010>
|
27
|
+
|
28
|
+
Get a single episode from URL
|
29
|
+
|
30
|
+
Buzzsprout.episode_from_url('http://changelogshow.com/105/12191-episode-0-3-0-sencha-touch-with-david-kaneda')
|
27
31
|
|
28
32
|
## Note on Patches/Pull Requests
|
29
33
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/buzzsprout.gemspec
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{buzzsprout}
|
8
|
+
s.version = "0.0.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Wynn Netherland"]
|
12
|
+
s.date = %q{2010-08-06}
|
13
|
+
s.description = %q{Ruby wrapper for the stealth mode Buzzsprout API}
|
14
|
+
s.email = %q{wynn.netherland@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
".yardopts",
|
23
|
+
"LICENSE",
|
24
|
+
"README.md",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"buzzsprout.gemspec",
|
28
|
+
"changelog.md",
|
29
|
+
"lib/buzzsprout.rb",
|
30
|
+
"lib/buzzsprout/client.rb",
|
31
|
+
"lib/buzzsprout/episode.rb",
|
32
|
+
"test/fixtures/episode.json",
|
33
|
+
"test/fixtures/episode_list.json",
|
34
|
+
"test/fixtures/tagged.json",
|
35
|
+
"test/helper.rb",
|
36
|
+
"test/test_buzzsprout.rb"
|
37
|
+
]
|
38
|
+
s.homepage = %q{http://wynnnetherland.com/projects/buzzsprout}
|
39
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
40
|
+
s.require_paths = ["lib"]
|
41
|
+
s.rubygems_version = %q{1.3.6}
|
42
|
+
s.summary = %q{Ruby wrapper for the stealth mode Buzzsprout API}
|
43
|
+
s.test_files = [
|
44
|
+
"test/helper.rb",
|
45
|
+
"test/test_buzzsprout.rb"
|
46
|
+
]
|
47
|
+
|
48
|
+
if s.respond_to? :specification_version then
|
49
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
50
|
+
s.specification_version = 3
|
51
|
+
|
52
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
53
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 2.3.2"])
|
54
|
+
s.add_runtime_dependency(%q<hashie>, [">= 0.2.0"])
|
55
|
+
s.add_runtime_dependency(%q<httparty>, [">= 0.5.0"])
|
56
|
+
s.add_development_dependency(%q<shoulda>, [">= 2.10.1"])
|
57
|
+
s.add_development_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
|
58
|
+
s.add_development_dependency(%q<fakeweb>, [">= 1.2.5"])
|
59
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<activesupport>, [">= 2.3.2"])
|
62
|
+
s.add_dependency(%q<hashie>, [">= 0.2.0"])
|
63
|
+
s.add_dependency(%q<httparty>, [">= 0.5.0"])
|
64
|
+
s.add_dependency(%q<shoulda>, [">= 2.10.1"])
|
65
|
+
s.add_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
|
66
|
+
s.add_dependency(%q<fakeweb>, [">= 1.2.5"])
|
67
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
68
|
+
end
|
69
|
+
else
|
70
|
+
s.add_dependency(%q<activesupport>, [">= 2.3.2"])
|
71
|
+
s.add_dependency(%q<hashie>, [">= 0.2.0"])
|
72
|
+
s.add_dependency(%q<httparty>, [">= 0.5.0"])
|
73
|
+
s.add_dependency(%q<shoulda>, [">= 2.10.1"])
|
74
|
+
s.add_dependency(%q<jnunemaker-matchy>, ["= 0.4.0"])
|
75
|
+
s.add_dependency(%q<fakeweb>, [">= 1.2.5"])
|
76
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
data/changelog.md
ADDED
data/lib/buzzsprout.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'time'
|
3
|
-
|
3
|
+
|
4
4
|
require 'activesupport'
|
5
5
|
|
6
|
-
gem 'hashie', '>= 0.1.3'
|
7
6
|
require 'hashie'
|
8
|
-
|
9
|
-
gem 'httparty', '>= 0.5.0'
|
10
7
|
require 'httparty'
|
11
8
|
|
12
9
|
|
@@ -35,6 +32,14 @@ module Buzzsprout
|
|
35
32
|
Client.episode(podcast_id, episode_id)
|
36
33
|
end
|
37
34
|
|
35
|
+
# Retrieve episode details
|
36
|
+
#
|
37
|
+
# @param [Fixnum] url URL of the episode
|
38
|
+
# @return [Episode] A list of episodes matching the query
|
39
|
+
def self.episode_from_url(url)
|
40
|
+
Client.episode_from_url(url)
|
41
|
+
end
|
42
|
+
|
38
43
|
end
|
39
44
|
|
40
45
|
require File.join(directory, 'buzzsprout', 'episode')
|
data/lib/buzzsprout/client.rb
CHANGED
@@ -26,6 +26,15 @@ module Buzzsprout
|
|
26
26
|
def self.episode(podcast_id, episode_id)
|
27
27
|
Buzzsprout::Episode.new(self.get("/#{podcast_id}/#{episode_id}.json")['episode'])
|
28
28
|
end
|
29
|
+
|
30
|
+
# Retrieve episode details
|
31
|
+
#
|
32
|
+
# @param [Fixnum] url URL of the episode
|
33
|
+
# @return [Episode] A list of episodes matching the query
|
34
|
+
def self.episode_from_url(url)
|
35
|
+
podcast_id, episode_id = url.split("/").map{|seg| seg.to_i}.reject{|i| i < 1 }
|
36
|
+
self.episode(podcast_id, episode_id)
|
37
|
+
end
|
29
38
|
end
|
30
39
|
|
31
40
|
end
|
data/test/test_buzzsprout.rb
CHANGED
@@ -17,6 +17,14 @@ class TestBuzzsprout < Test::Unit::TestCase
|
|
17
17
|
list.last.id.should == 1959
|
18
18
|
end
|
19
19
|
|
20
|
+
should "parse an episode url and fetch episode info" do
|
21
|
+
stub_get("/105/12191.json", "episode.json")
|
22
|
+
url = "http://changelogshow.com/105/12191-episode-0-3-0-sencha-touch-with-david-kaneda"
|
23
|
+
ep = Buzzsprout.episode_from_url(url)
|
24
|
+
ep.tags.size.should == 6
|
25
|
+
ep.tags.first.should == 'git'
|
26
|
+
end
|
27
|
+
|
20
28
|
context "when fetching info for a single episode" do
|
21
29
|
|
22
30
|
setup do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Wynn Netherland
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06
|
17
|
+
date: 2010-08-06 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -130,6 +130,8 @@ files:
|
|
130
130
|
- README.md
|
131
131
|
- Rakefile
|
132
132
|
- VERSION
|
133
|
+
- buzzsprout.gemspec
|
134
|
+
- changelog.md
|
133
135
|
- lib/buzzsprout.rb
|
134
136
|
- lib/buzzsprout/client.rb
|
135
137
|
- lib/buzzsprout/episode.rb
|