zazzle 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in zazzle.gemspec
4
+ gemspec
data/README ADDED
File without changes
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,37 @@
1
+ require "zazzle/version"
2
+
3
+ class Zazzle
4
+
5
+ class << self
6
+
7
+ attr_accessor :associate_id
8
+
9
+ def product_link(product_id, page = 'productpage', options = {})
10
+ params = {:rf => associate_id ,
11
+ :ax => 'linkover' ,
12
+ :pd => product_id ,
13
+ :fwd => page,
14
+ :ed => true}.merge(options)
15
+ build_request(params)
16
+ end
17
+
18
+ def buffet_link(category_id, options = {})
19
+ params = {:rf => associate_id ,
20
+ :ax => 'designblast' ,
21
+ :cg => category_id ,
22
+ :fwd => page,
23
+ :ed => true}.merge(options)
24
+ build_request(params)
25
+ end
26
+
27
+
28
+ private
29
+
30
+ def build_request(params = {})
31
+ ["http://www.zazzle.com/api/create/at-#{associate_id}" , "?"+params.to_a.map{|p| p.join('=')}.join('&')].join()
32
+ end
33
+
34
+ end
35
+
36
+ end
37
+
@@ -0,0 +1,4 @@
1
+ class Zazzle
2
+ VERSION = "0.0.1"
3
+ end
4
+
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "zazzle/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "zazzle"
7
+ s.version = Zazzle::VERSION
8
+ s.authors = ["Nicolas Santa"]
9
+ s.email = ["nicolas55ar@gmail.com"]
10
+ s.homepage = "http://github.com/nsanta/zazzle"
11
+ s.summary = %q{Zazzle.com API wrapper}
12
+ s.description = %q{Zazzle.com API wrapper}
13
+
14
+ s.rubyforge_project = "zazzle"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ # s.add_runtime_dependency "rest-client"
24
+ end
25
+
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zazzle
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Nicolas Santa
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-09-05 00:00:00 Z
19
+ dependencies: []
20
+
21
+ description: Zazzle.com API wrapper
22
+ email:
23
+ - nicolas55ar@gmail.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - .gitignore
32
+ - Gemfile
33
+ - README
34
+ - Rakefile
35
+ - lib/zazzle.rb
36
+ - lib/zazzle/version.rb
37
+ - zazzle.gemspec
38
+ homepage: http://github.com/nsanta/zazzle
39
+ licenses: []
40
+
41
+ post_install_message:
42
+ rdoc_options: []
43
+
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ hash: 3
52
+ segments:
53
+ - 0
54
+ version: "0"
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 0
63
+ version: "0"
64
+ requirements: []
65
+
66
+ rubyforge_project: zazzle
67
+ rubygems_version: 1.8.10
68
+ signing_key:
69
+ specification_version: 3
70
+ summary: Zazzle.com API wrapper
71
+ test_files: []
72
+