mcornick-laika 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/README.markdown +1 -3
- data/Rakefile +72 -31
- data/VERSION +1 -0
- data/bin/laika +0 -2
- data/bin/laika-auth +7 -3
- data/laika.gemspec +63 -0
- data/lib/laika/yammer.rb +1 -0
- metadata +30 -23
- data/lib/laika/version.rb +0 -13
data/README.markdown
CHANGED
@@ -18,12 +18,11 @@ Then, you'll need to do the OAuth exchange, which will give you an access token
|
|
18
18
|
|
19
19
|
laika-auth
|
20
20
|
|
21
|
-
This will prompt you for the client key and secret you just obtained. It will then echo a URL which you will need to visit while still logged in to Yammer as the user from the previous step. You'll be asked to authorize your application. Click the Authorize button
|
21
|
+
This will prompt you for the client key and secret you just obtained. It will then echo a URL which you will need to visit while still logged in to Yammer as the user from the previous step. You'll be asked to authorize your application. Click the Authorize button. Yammer will give you a four-character security code. Go back to your terminal, enter that code and hit Return. The script will then get the access token and secret from Yammer, and store all four pieces of information in a file called laika.yml. **Don't lose this file!** It constitutes the credentials that you will need to do anything useful with Laika. It is not encrypted, so keep it secure. Once you have the laika.yml file, you will not need to do these steps again unless you de-authorize the application.
|
22
22
|
|
23
23
|
Now you're ready to start barking about feeds. You can see all Laika's options by running it with the --help option:
|
24
24
|
|
25
25
|
$ ./bin/laika --help
|
26
|
-
Laika 1.0.0
|
27
26
|
Options:
|
28
27
|
--feed-file, -f <s>: File to store feed data
|
29
28
|
--credential-file, -c <s>: File with Yammer credential data (from
|
@@ -31,7 +30,6 @@ Now you're ready to start barking about feeds. You can see all Laika's options b
|
|
31
30
|
--url, -u <s>: URL of the feed to bark about
|
32
31
|
--dont-yammer, -d: Don't post to Yammer, just echo to standard out
|
33
32
|
--announcement, -a <s>: Announcement format. See the documentation
|
34
|
-
--version, -v: Print version and exit
|
35
33
|
--help, -h: Show this message
|
36
34
|
|
37
35
|
The only 100% mandatory option is --feed-file, which is a YAML file to which Laika will write the feed data and the posts it has already barked about.
|
data/Rakefile
CHANGED
@@ -1,41 +1,82 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'rake
|
3
|
-
require 'rake/testtask'
|
2
|
+
require 'rake'
|
4
3
|
|
5
|
-
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "laika"
|
8
|
+
gem.summary = "Barks about new blog posts via the Yammer API and OAuth."
|
9
|
+
gem.description = "Laika is a simple script to monitor an RSS or Atom feed, and post to Yammer when new articles are detected."
|
10
|
+
gem.email = "mark@viget.com"
|
11
|
+
gem.homepage = "http://github.com/vigetlabs/laika"
|
12
|
+
gem.authors = ["Mark Cornick"]
|
13
|
+
gem.rubyforge_project = "viget"
|
14
|
+
gem.add_dependency 'trollop', '>= 1.10.2'
|
15
|
+
gem.add_dependency 'oauth', '>= 0.2.7'
|
16
|
+
gem.add_dependency 'feed-normalizer', '>= 1.5.1'
|
17
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
|
+
end
|
6
19
|
|
7
|
-
|
20
|
+
Jeweler::RubyforgeTasks.new do |rubyforge|
|
21
|
+
rubyforge.doc_task = "yardoc"
|
22
|
+
end
|
23
|
+
rescue LoadError
|
24
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
25
|
+
end
|
8
26
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
s.summary = "Barks about new blog posts via the Yammer API and OAuth."
|
15
|
-
s.author = 'Mark Cornick'
|
16
|
-
s.email = 'mark.cornick@viget.com'
|
17
|
-
s.homepage = 'http://www.viget.com/'
|
18
|
-
s.files = %w(README.markdown Rakefile) + Dir.glob("{lib,test,bin}/**/*")
|
19
|
-
s.executables = %w(laika laika-auth)
|
20
|
-
|
21
|
-
s.add_dependency('oauth', '>=0.2.7')
|
22
|
-
s.add_dependency('feed-normalizer', '>=1.5.1')
|
23
|
-
s.add_dependency('trollop', '>=1.10.2')
|
27
|
+
require 'rake/testtask'
|
28
|
+
Rake::TestTask.new(:test) do |test|
|
29
|
+
test.libs << 'lib' << 'test'
|
30
|
+
test.pattern = 'test/**/*_test.rb'
|
31
|
+
test.verbose = true
|
24
32
|
end
|
25
33
|
|
26
|
-
|
27
|
-
|
34
|
+
begin
|
35
|
+
require 'rcov/rcovtask'
|
36
|
+
Rcov::RcovTask.new do |test|
|
37
|
+
test.libs << 'test'
|
38
|
+
test.pattern = 'test/**/*_test.rb'
|
39
|
+
test.verbose = true
|
40
|
+
test.rcov_opts << '-x gems'
|
41
|
+
end
|
42
|
+
rescue LoadError
|
43
|
+
task :rcov do
|
44
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install relevance-rcov"
|
45
|
+
end
|
28
46
|
end
|
29
47
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
48
|
+
begin
|
49
|
+
require 'reek/rake_task'
|
50
|
+
Reek::RakeTask.new do |t|
|
51
|
+
t.fail_on_error = true
|
52
|
+
t.verbose = false
|
53
|
+
t.source_files = 'lib/**/*.rb'
|
54
|
+
end
|
55
|
+
rescue LoadError
|
56
|
+
task :reek do
|
57
|
+
abort "Reek is not available. In order to run reek, you must: sudo gem install reek"
|
58
|
+
end
|
34
59
|
end
|
35
60
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
61
|
+
begin
|
62
|
+
require 'roodi'
|
63
|
+
require 'roodi_task'
|
64
|
+
RoodiTask.new do |t|
|
65
|
+
t.verbose = false
|
66
|
+
end
|
67
|
+
rescue LoadError
|
68
|
+
task :roodi do
|
69
|
+
abort "Roodi is not available. In order to run roodi, you must: sudo gem install roodi"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
task :default => :test
|
74
|
+
|
75
|
+
begin
|
76
|
+
require 'yard'
|
77
|
+
YARD::Rake::YardocTask.new
|
78
|
+
rescue LoadError
|
79
|
+
task :yardoc do
|
80
|
+
abort "Yard is not available. In order to run yardoc, you must: sudo gem install yard"
|
81
|
+
end
|
82
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.2.0
|
data/bin/laika
CHANGED
@@ -2,11 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'laika'
|
5
|
-
require 'laika/version'
|
6
5
|
require 'trollop'
|
7
6
|
|
8
7
|
opts = Trollop::options do
|
9
|
-
version "Laika #{Laika::Version}"
|
10
8
|
opt :feed_file, "File to store feed data", :type => String
|
11
9
|
opt :credential_file, "File with Yammer credential data (from laika-auth)", :type => String, :default => 'laika.yml'
|
12
10
|
opt :url, "URL of the feed to bark about", :type => String
|
data/bin/laika-auth
CHANGED
@@ -12,9 +12,13 @@ consumer_secret = gets.chomp
|
|
12
12
|
begin
|
13
13
|
consumer = OAuth::Consumer.new consumer_key, consumer_secret, { :site => "https://www.yammer.com" }
|
14
14
|
request_token = consumer.get_request_token
|
15
|
-
puts "Please go to:\n#{request_token.authorize_url}\nin your browser
|
16
|
-
|
17
|
-
|
15
|
+
puts "Please go to:\n#{request_token.authorize_url}\nin your browser to authorize your application."
|
16
|
+
puts "You should receive a four-character security code.\nEnter it and hit Return here when you are done."
|
17
|
+
callback_token = gets
|
18
|
+
response = consumer.token_request(consumer.http_method,
|
19
|
+
(consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path),
|
20
|
+
request_token, {}, :callback_token => callback_token.chomp)
|
21
|
+
access_token = OAuth::AccessToken.new(consumer,response[:oauth_token],response[:oauth_token_secret])
|
18
22
|
credentials = {
|
19
23
|
:consumer_key => consumer.key,
|
20
24
|
:consumer_secret => consumer.secret,
|
data/laika.gemspec
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{laika}
|
8
|
+
s.version = "1.2.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Mark Cornick"]
|
12
|
+
s.date = %q{2009-08-06}
|
13
|
+
s.email = %q{mark@viget.com}
|
14
|
+
s.executables = ["laika", "laika-auth"]
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.markdown"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".gitignore",
|
20
|
+
"README.markdown",
|
21
|
+
"Rakefile",
|
22
|
+
"VERSION",
|
23
|
+
"bin/laika",
|
24
|
+
"bin/laika-auth",
|
25
|
+
"laika.gemspec",
|
26
|
+
"lib/laika.rb",
|
27
|
+
"lib/laika/blog.rb",
|
28
|
+
"lib/laika/yammer.rb",
|
29
|
+
"test/blog_test.rb",
|
30
|
+
"test/test_common.rb",
|
31
|
+
"test/yammer_test.rb"
|
32
|
+
]
|
33
|
+
s.homepage = %q{http://github.com/vigetlabs/laika}
|
34
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
35
|
+
s.require_paths = ["lib"]
|
36
|
+
s.rubyforge_project = %q{viget}
|
37
|
+
s.rubygems_version = %q{1.3.4}
|
38
|
+
s.summary = %q{Barks about new blog posts via the Yammer API and OAuth.}
|
39
|
+
s.test_files = [
|
40
|
+
"test/blog_test.rb",
|
41
|
+
"test/test_common.rb",
|
42
|
+
"test/yammer_test.rb"
|
43
|
+
]
|
44
|
+
|
45
|
+
if s.respond_to? :specification_version then
|
46
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
47
|
+
s.specification_version = 3
|
48
|
+
|
49
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
50
|
+
s.add_runtime_dependency(%q<trollop>, [">= 1.10.2"])
|
51
|
+
s.add_runtime_dependency(%q<oauth>, [">= 0.2.7"])
|
52
|
+
s.add_runtime_dependency(%q<feed-normalizer>, [">= 1.5.1"])
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<trollop>, [">= 1.10.2"])
|
55
|
+
s.add_dependency(%q<oauth>, [">= 0.2.7"])
|
56
|
+
s.add_dependency(%q<feed-normalizer>, [">= 1.5.1"])
|
57
|
+
end
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<trollop>, [">= 1.10.2"])
|
60
|
+
s.add_dependency(%q<oauth>, [">= 0.2.7"])
|
61
|
+
s.add_dependency(%q<feed-normalizer>, [">= 1.5.1"])
|
62
|
+
end
|
63
|
+
end
|
data/lib/laika/yammer.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mcornick-laika
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Cornick
|
@@ -9,38 +9,41 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-08-06 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: trollop
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
20
21
|
- - ">="
|
21
22
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
23
|
+
version: 1.10.2
|
23
24
|
version:
|
24
25
|
- !ruby/object:Gem::Dependency
|
25
|
-
name:
|
26
|
+
name: oauth
|
27
|
+
type: :runtime
|
26
28
|
version_requirement:
|
27
29
|
version_requirements: !ruby/object:Gem::Requirement
|
28
30
|
requirements:
|
29
31
|
- - ">="
|
30
32
|
- !ruby/object:Gem::Version
|
31
|
-
version:
|
33
|
+
version: 0.2.7
|
32
34
|
version:
|
33
35
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
36
|
+
name: feed-normalizer
|
37
|
+
type: :runtime
|
35
38
|
version_requirement:
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
43
|
+
version: 1.5.1
|
41
44
|
version:
|
42
45
|
description:
|
43
|
-
email: mark
|
46
|
+
email: mark@viget.com
|
44
47
|
executables:
|
45
48
|
- laika
|
46
49
|
- laika-auth
|
@@ -49,23 +52,25 @@ extensions: []
|
|
49
52
|
extra_rdoc_files:
|
50
53
|
- README.markdown
|
51
54
|
files:
|
55
|
+
- .gitignore
|
52
56
|
- README.markdown
|
53
57
|
- Rakefile
|
54
|
-
-
|
58
|
+
- VERSION
|
59
|
+
- bin/laika
|
60
|
+
- bin/laika-auth
|
61
|
+
- laika.gemspec
|
62
|
+
- lib/laika.rb
|
55
63
|
- lib/laika/blog.rb
|
56
|
-
- lib/laika/version.rb
|
57
64
|
- lib/laika/yammer.rb
|
58
|
-
- lib/laika.rb
|
59
65
|
- test/blog_test.rb
|
60
66
|
- test/test_common.rb
|
61
67
|
- test/yammer_test.rb
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
homepage: http://www.viget.com/
|
68
|
+
has_rdoc: false
|
69
|
+
homepage: http://github.com/vigetlabs/laika
|
70
|
+
licenses:
|
66
71
|
post_install_message:
|
67
|
-
rdoc_options:
|
68
|
-
|
72
|
+
rdoc_options:
|
73
|
+
- --charset=UTF-8
|
69
74
|
require_paths:
|
70
75
|
- lib
|
71
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -82,10 +87,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
87
|
version:
|
83
88
|
requirements: []
|
84
89
|
|
85
|
-
rubyforge_project:
|
86
|
-
rubygems_version: 1.
|
90
|
+
rubyforge_project: viget
|
91
|
+
rubygems_version: 1.3.5
|
87
92
|
signing_key:
|
88
|
-
specification_version:
|
93
|
+
specification_version: 3
|
89
94
|
summary: Barks about new blog posts via the Yammer API and OAuth.
|
90
|
-
test_files:
|
91
|
-
|
95
|
+
test_files:
|
96
|
+
- test/blog_test.rb
|
97
|
+
- test/test_common.rb
|
98
|
+
- test/yammer_test.rb
|