ebayer 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 kranthicu
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ = ebayer
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to ebayer
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 kranthicu. See LICENSE.txt for
18
+ further details.
19
+
@@ -0,0 +1,4 @@
1
+ require 'httparty'
2
+ require 'json'
3
+ require 'hashie'
4
+ require 'ebayer/get_user_profile'
@@ -0,0 +1,41 @@
1
+ class Ebay
2
+
3
+ attr_accessor :open_url, :callname, :response_encoding, :app_id, :user_id, :response
4
+
5
+
6
+ def initialize(open_url, callname, response_encoding, api_version, app_id, user_id)
7
+ @open_url = open_url
8
+ @callname = callname
9
+ @response_encoding= response_encoding
10
+ @api_version = api_version
11
+ @app_id = app_id
12
+ @user_id = user_id
13
+ end
14
+
15
+
16
+
17
+ def url_definer
18
+ url = @open_url+"?callname=#{@callname}&responseencoding=#{@response_encoding}&appid=#{@app_id}&siteid=0&UserID=#{@user_id}&IncludeSelector=Details&version=#{@api_version}"
19
+ return url
20
+ end
21
+
22
+ def request_ebay
23
+ requested_url = self.url_definer
24
+ new_response = HTTParty.get(requested_url)
25
+ @response = self.response_parser(new_response.body)
26
+ end
27
+
28
+ def response_parser(response_content)
29
+ Hashie::Mash.new(JSON(response_content))
30
+ end
31
+
32
+ def success?
33
+ self.response_content ? (self.response_content["Ack"] == "Success") : (self.response_content["Ack"] == "Failure")
34
+ end
35
+
36
+ def user_information
37
+ self.request_ebay
38
+ end
39
+
40
+
41
+ end
metadata ADDED
@@ -0,0 +1,144 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ebayer
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - kranthicu
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-06-09 00:00:00.000000000 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ requirement: &85449590 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 2.3.0
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: *85449590
26
+ - !ruby/object:Gem::Dependency
27
+ name: bundler
28
+ requirement: &85449340 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: *85449340
37
+ - !ruby/object:Gem::Dependency
38
+ name: jeweler
39
+ requirement: &85449090 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: 1.6.2
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *85449090
48
+ - !ruby/object:Gem::Dependency
49
+ name: rcov
50
+ requirement: &85448830 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *85448830
59
+ - !ruby/object:Gem::Dependency
60
+ name: httparty
61
+ requirement: &85448570 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ type: :development
68
+ prerelease: false
69
+ version_requirements: *85448570
70
+ - !ruby/object:Gem::Dependency
71
+ name: json
72
+ requirement: &85448320 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: *85448320
81
+ - !ruby/object:Gem::Dependency
82
+ name: hashie
83
+ requirement: &85448040 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: *85448040
92
+ - !ruby/object:Gem::Dependency
93
+ name: rspec
94
+ requirement: &85447790 !ruby/object:Gem::Requirement
95
+ none: false
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ type: :development
101
+ prerelease: false
102
+ version_requirements: *85447790
103
+ description: This gem intended to use Ebay API withint ruby/rails applications
104
+ email: kranthicu@gmail.com
105
+ executables: []
106
+ extensions: []
107
+ extra_rdoc_files:
108
+ - LICENSE.txt
109
+ - README.rdoc
110
+ files:
111
+ - lib/ebayer.rb
112
+ - lib/ebayer/get_user_profile.rb
113
+ - LICENSE.txt
114
+ - README.rdoc
115
+ has_rdoc: true
116
+ homepage: http://github.com/kranthicu/ebayer
117
+ licenses:
118
+ - MIT
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ! '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ segments:
130
+ - 0
131
+ hash: 120906035
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ none: false
134
+ requirements:
135
+ - - ! '>='
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ requirements: []
139
+ rubyforge_project:
140
+ rubygems_version: 1.6.2
141
+ signing_key:
142
+ specification_version: 3
143
+ summary: Ebay API now made easy for rubyists and rails
144
+ test_files: []