rebuildfm 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +71 -0
- data/Rakefile +1 -0
- data/bin/rebuildfm +3 -0
- data/lib/rebuildfm/cli.rb +58 -0
- data/lib/rebuildfm/version.rb +3 -0
- data/lib/rebuildfm.rb +6 -0
- data/rebuildfm.gemspec +25 -0
- metadata +121 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 TODO: Write your name
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# rebuildfm
|
2
|
+
|
3
|
+
This program is the ruby client for rebuildfm(http://rebuild.fm/)
|
4
|
+
|
5
|
+
## Requirements
|
6
|
+
This program works on Mac OS X because it uses AppleScript and iTunes.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
```
|
11
|
+
$ gem install rebuildfm
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
List episodes
|
17
|
+
|
18
|
+
```
|
19
|
+
$ rebuildfm list
|
20
|
+
1: Podcasting, LTSV, RubyMotion (伊藤直也)
|
21
|
+
2: Rails, Redis, VPS (Kenn Ejima)
|
22
|
+
3: MessagePack (frsyuki, kiyoto)
|
23
|
+
...
|
24
|
+
34: Snappy Links (naan)
|
25
|
+
35: You Don't Need API Version 2 (Kenn Ejima)
|
26
|
+
36: Hubot, Deploy this Pull Request (Naoya Ito)
|
27
|
+
```
|
28
|
+
|
29
|
+
Play an episode
|
30
|
+
|
31
|
+
```
|
32
|
+
$ rebuildfm play 36
|
33
|
+
伊藤直也さん (@naoya_ito) をゲストに迎えて、JAWS、Vagrant Share、CoffeeScript、コードレビューなどについて話しました。
|
34
|
+
|
35
|
+
Show Notes
|
36
|
+
|
37
|
+
* JAWS DAYS 2014、Immutable Infrastructure について
|
38
|
+
* You don't need API version 2 - yohei's diary
|
39
|
+
* Cookpad's deployment and auto scaling
|
40
|
+
* Docker 0.9: introducing execution drivers and libcontainer | Docker Blog
|
41
|
+
* Vagrant 1.5 and Vagrant Cloud - Vagrant
|
42
|
+
* ngrok - secure introspectable tunnels to localhost
|
43
|
+
* RequestBin - Collect, inspect and debug HTTP requests and webhooks
|
44
|
+
* Idobata ★
|
45
|
+
* Idobata会議01 ★
|
46
|
+
* Hubot, Chat, The Web, and Working in the Open
|
47
|
+
* Hands-on with GitHub's New Text Editor Atom
|
48
|
+
* Why coffeescript? - Atom Discussion
|
49
|
+
* 些末なコードレビュー
|
50
|
+
* cookpad/styleguide
|
51
|
+
* bbatsov/rubocop
|
52
|
+
* Deploy feature branch to Heroku with CircleCI
|
53
|
+
```
|
54
|
+
|
55
|
+
Stop an episode
|
56
|
+
|
57
|
+
```
|
58
|
+
$ rebuildfm stop
|
59
|
+
```
|
60
|
+
|
61
|
+
## Reference
|
62
|
+
* https://github.com/mattn/rebuildfm
|
63
|
+
* https://github.com/syohex/emacs-rebuildfm
|
64
|
+
|
65
|
+
## Contributing
|
66
|
+
|
67
|
+
1. Fork it ( http://github.com/wyukawa/ruby-rebuildfm/fork )
|
68
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
69
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
70
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
71
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/rebuildfm
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require "rebuildfm"
|
2
|
+
require 'thor'
|
3
|
+
require 'rss'
|
4
|
+
require 'nokogiri'
|
5
|
+
|
6
|
+
module Rebuildfm
|
7
|
+
|
8
|
+
class CLI < Thor
|
9
|
+
|
10
|
+
URL = 'http://feeds.rebuild.fm/rebuildfm'
|
11
|
+
|
12
|
+
desc "list", "list rebuildfm"
|
13
|
+
def list()
|
14
|
+
rss = RSS::Parser.parse(URL)
|
15
|
+
rss.items.reverse.each{|item|
|
16
|
+
puts item.title
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "play [index]", "play rebuildfm"
|
21
|
+
def play(index)
|
22
|
+
begin
|
23
|
+
i=Integer(index)
|
24
|
+
rescue
|
25
|
+
raise ArgumentError, "#{index} is not integer"
|
26
|
+
end
|
27
|
+
rss = RSS::Parser.parse(URL)
|
28
|
+
if i <= 0 || i > rss.items.length then
|
29
|
+
raise ArgumentError, "#{i} is not in [1 .. #{rss.items.length}]"
|
30
|
+
end
|
31
|
+
rss = RSS::Parser.parse(URL)
|
32
|
+
html = rss.items[rss.items.length - i].description
|
33
|
+
doc = Nokogiri::HTML.parse(html)
|
34
|
+
body = doc.xpath('/html/body')
|
35
|
+
summary = body.xpath('p')[0].inner_text.strip
|
36
|
+
puts summary
|
37
|
+
puts "\n"
|
38
|
+
puts "Show Notes"
|
39
|
+
puts "\n"
|
40
|
+
body.xpath('ul/li').each{|li|
|
41
|
+
puts "* " + li.xpath('a').inner_text.strip
|
42
|
+
}
|
43
|
+
system("osascript -e \'tell application \"iTunes\"\' -e 'open location \"#{rss.items[rss.items.length - i].enclosure.url}\" play' -e 'end tell'")
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "stop", "stop rebuildfm"
|
47
|
+
def stop()
|
48
|
+
system("osascript -e \'tell application \"iTunes\"\' -e 'stop' -e 'end tell'")
|
49
|
+
end
|
50
|
+
|
51
|
+
# comment out because I don't understand how to resume
|
52
|
+
#desc "pause", "pause rebuildfm"
|
53
|
+
#def pause()
|
54
|
+
# system("osascript -e \'tell application \"iTunes\"\' -e 'pause' -e 'end tell'")
|
55
|
+
#end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
data/lib/rebuildfm.rb
ADDED
data/rebuildfm.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rebuildfm/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "rebuildfm"
|
8
|
+
spec.version = Rebuildfm::VERSION
|
9
|
+
spec.authors = ["wyukawa"]
|
10
|
+
spec.email = ["wyukawa@gmail.com"]
|
11
|
+
spec.summary = %q{rebuildfm ruby client}
|
12
|
+
spec.description = %q{rebuildfm ruby client}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "thor"
|
24
|
+
spec.add_development_dependency "nokogiri"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rebuildfm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- wyukawa
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-03-21 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.5'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.5'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: thor
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: nokogiri
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: rebuildfm ruby client
|
79
|
+
email:
|
80
|
+
- wyukawa@gmail.com
|
81
|
+
executables:
|
82
|
+
- rebuildfm
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files: []
|
85
|
+
files:
|
86
|
+
- .gitignore
|
87
|
+
- Gemfile
|
88
|
+
- LICENSE.txt
|
89
|
+
- README.md
|
90
|
+
- Rakefile
|
91
|
+
- bin/rebuildfm
|
92
|
+
- lib/rebuildfm.rb
|
93
|
+
- lib/rebuildfm/cli.rb
|
94
|
+
- lib/rebuildfm/version.rb
|
95
|
+
- rebuildfm.gemspec
|
96
|
+
homepage: ''
|
97
|
+
licenses:
|
98
|
+
- MIT
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
none: false
|
105
|
+
requirements:
|
106
|
+
- - ! '>='
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ! '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
requirements: []
|
116
|
+
rubyforge_project:
|
117
|
+
rubygems_version: 1.8.23.2
|
118
|
+
signing_key:
|
119
|
+
specification_version: 3
|
120
|
+
summary: rebuildfm ruby client
|
121
|
+
test_files: []
|