slide_share 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in slide_share.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ slide_share (0.0.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ crack (0.1.8)
10
+ diff-lcs (1.1.2)
11
+ httparty (0.6.1)
12
+ crack (= 0.1.8)
13
+ rspec (2.4.0)
14
+ rspec-core (~> 2.4.0)
15
+ rspec-expectations (~> 2.4.0)
16
+ rspec-mocks (~> 2.4.0)
17
+ rspec-core (2.4.0)
18
+ rspec-expectations (2.4.0)
19
+ diff-lcs (~> 1.1.2)
20
+ rspec-mocks (2.4.0)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ httparty
27
+ rspec
28
+ slide_share!
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,3 @@
1
+ module SlideShare
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,37 @@
1
+ require 'digest/sha1'
2
+ require "httparty"
3
+
4
+ class SlideShare
5
+ include HTTParty
6
+ @@API_KEY
7
+ @@SECRET
8
+
9
+ def self.API_KEY=(value)
10
+ @@API_KEY = value
11
+ end
12
+
13
+ def self.SECRET=(value)
14
+ @@SECRET = value
15
+ end
16
+
17
+ def self.get_slideshows_by_user(username)
18
+ params = create_parameters
19
+ params[:username_for] = username
20
+ get("http://www.slideshare.net/api/2/get_slideshows_by_user", :query => params)
21
+ end
22
+
23
+ private
24
+ def self.create_parameters
25
+ params = {}
26
+ params[:api_key] = @@API_KEY
27
+
28
+ timestamp = Time.now.to_i
29
+ ss_hash = Digest::SHA1.hexdigest (@@SECRET + timestamp.to_s)
30
+
31
+ params[:ts] = timestamp
32
+ params[:hash] = ss_hash
33
+ params[:format] = "json"
34
+ return params
35
+ end
36
+
37
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "slide_share/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "slide_share"
7
+ s.version = SlideShare::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Jonathan Birkholz"]
10
+ s.email = ["rookieone@gmail.com"]
11
+ s.homepage = "http://rubygems.org/gems/slide_share"
12
+ s.summary = %q{Gem for SlideShare using HTTParty}
13
+ s.description = %q{Gem for SlideShare using HTTParty}
14
+
15
+ s.rubyforge_project = "slide_share"
16
+
17
+ s.add_development_dependency "rspec"
18
+ s.add_development_dependency "httparty"
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
+ s.require_paths = ["lib"]
24
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe SlideShare do
4
+ before(:each) do
5
+ SlideShare.API_KEY = "IUKyhLLC"
6
+ SlideShare.SECRET = "PdZ8enD1"
7
+ end
8
+
9
+ describe "get slideshows by user" do
10
+ before(:each) do
11
+ @talks = SlideShare.get_slideshows_by_user("rookieone")
12
+ end
13
+
14
+ it { @talks.should_not be_nil }
15
+ it { @talks.should_not be_empty }
16
+ end
17
+
18
+
19
+ end
@@ -0,0 +1,2 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'slide_share')
2
+ require 'httparty'
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slide_share
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Jonathan Birkholz
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-05 00:00:00 -06:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ type: :development
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: httparty
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ type: :development
45
+ version_requirements: *id002
46
+ description: Gem for SlideShare using HTTParty
47
+ email:
48
+ - rookieone@gmail.com
49
+ executables: []
50
+
51
+ extensions: []
52
+
53
+ extra_rdoc_files: []
54
+
55
+ files:
56
+ - .gitignore
57
+ - Gemfile
58
+ - Gemfile.lock
59
+ - Rakefile
60
+ - lib/slide_share.rb
61
+ - lib/slide_share/version.rb
62
+ - slide_share.gemspec
63
+ - spec/slide_share_spec.rb
64
+ - spec/spec_helper.rb
65
+ has_rdoc: true
66
+ homepage: http://rubygems.org/gems/slide_share
67
+ licenses: []
68
+
69
+ post_install_message:
70
+ rdoc_options: []
71
+
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ requirements: []
91
+
92
+ rubyforge_project: slide_share
93
+ rubygems_version: 1.3.7
94
+ signing_key:
95
+ specification_version: 3
96
+ summary: Gem for SlideShare using HTTParty
97
+ test_files:
98
+ - spec/slide_share_spec.rb
99
+ - spec/spec_helper.rb