gravatar_profile 1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +16 -2
- data/MIT-LICENSE +20 -0
- data/README.rdoc +30 -17
- data/gravatar_profile.gemspec +3 -3
- data/lib/gravatar_profile.rb +1 -1
- metadata +13 -4
data/CHANGELOG.rdoc
CHANGED
@@ -1,2 +1,16 @@
|
|
1
|
-
=== 0
|
2
|
-
|
1
|
+
=== 1.0 / 2010-11-29
|
2
|
+
|
3
|
+
* Initial Release.
|
4
|
+
|
5
|
+
=== 1.0.1 / 2010-11-30
|
6
|
+
|
7
|
+
* Correction in README File.
|
8
|
+
|
9
|
+
=== 1.1.0 / 2010-11-30
|
10
|
+
|
11
|
+
* Correction in README File.
|
12
|
+
* Getting profile information from XML formatted profile url is hardcoded.
|
13
|
+
|
14
|
+
=== 1.2.0 / 2011-09-07
|
15
|
+
|
16
|
+
* Missing MIT-LICENSE added.
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Veerasundaravel Thirugnanasundaram
|
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.
|
data/README.rdoc
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
= Author
|
2
|
-
Veerasundaravel Thirugnanasundaram <veerasundaravel@gmail.
|
2
|
+
Veerasundaravel Thirugnanasundaram <veerasundaravel@gmail.com>
|
3
|
+
|
3
4
|
http://veerasundaravel.wordpress.com
|
4
5
|
|
5
6
|
= Synopsis
|
@@ -13,33 +14,45 @@ Using the GravatarProfile library is fairly simple and straight-forward. The ba
|
|
13
14
|
class most of you will be using is the GravatarProfile class.
|
14
15
|
|
15
16
|
=== Installation
|
16
|
-
sudo gem install gravatar_profile
|
17
|
+
sudo gem install gravatar_profile
|
17
18
|
|
18
19
|
===Getting Gravatar image
|
19
20
|
|
20
|
-
gravatar = GravatarProfile.new("your-email-address")
|
21
|
-
|
22
|
-
|
21
|
+
gravatar = GravatarProfile.new("your-email-address")
|
22
|
+
|
23
|
+
gp.gravatar_url
|
24
|
+
|
25
|
+
>> "http://gravatar.com/avatar/6fa14cea01672568042121f81c33d5fbb.png"
|
23
26
|
|
24
27
|
|
25
28
|
=== Getting Gravatar Profile Url
|
26
29
|
|
27
|
-
gp = GravatarProfile.new("your-email-address"
|
28
|
-
|
29
|
-
|
30
|
+
gp = GravatarProfile.new("your-email-address")
|
31
|
+
|
32
|
+
gp.gravatar_profile_url
|
33
|
+
|
34
|
+
>> "http://gravatar.com/6fa14cea01672568042121f81c33d5fbb"
|
35
|
+
|
30
36
|
|
31
|
-
gp = GravatarProfile.new("your-email-address"")
|
32
|
-
|
33
|
-
|
37
|
+
gp = GravatarProfile.new("your-email-address"")
|
38
|
+
|
39
|
+
gp.gravatar_profile_url(:filetype => :xml)
|
40
|
+
|
41
|
+
>> "http://gravatar.com/6fa14cea01672568042121f81c33d5fbb"
|
34
42
|
|
35
43
|
|
36
44
|
=== Accessing profile informations
|
45
|
+
Accessing profile information is much simpler, just you need to call the function get_profile_info and it will return entire information of the gravatar user as a hash.
|
46
|
+
|
47
|
+
gp = GravatarProfile.new("some-email-address")
|
48
|
+
|
49
|
+
|
50
|
+
#It will return a collection of profile information as Hash from gravatar.
|
51
|
+
|
52
|
+
gp.get_profile_info
|
37
53
|
|
38
|
-
|
54
|
+
#If your server need to use proxyy means specify the proxy details as follows.
|
39
55
|
|
40
|
-
|
41
|
-
gp.get_profile_info({:filetype => :xml})
|
56
|
+
gp.get_profile_info({:proxy_host => 'www.some-proxy.com', :proxy_port=>8000})
|
42
57
|
|
43
|
-
|
44
|
-
gp.get_profile_info({:proxy_host => 'www.some-proxy.com', :proxy_port=>8000, :filetype => :xml})
|
45
|
-
>> {"name"=>[{"givenName"=>["User-GivenName"], "familyName"=>["FamilyName"], "formatted"=>["User-GivenName Lastname"]}], "requestHash"=>["6fa14cea067256804121f81c33d5fbb"], "preferredUsername"=>["user-givenname"], "displayName"=>["user-givenname"], "thumbnailUrl"=>["http://2.gravatar.com/avatar/6fadss14cea0167256804121f81c3d5fbb"], "hash"=>["6fadss14cea0167256804121f81c33d5fbb"], "urls"=>[{"value"=>["http://in.linkedin.com/pub/abced/8/11b/15"]}, {"title"=>["Ruby on Rails Weblog"], "value"=["http://user-givenname.wordpress.com"]}, {"title"=>["Twitter Account"], "value"=>["http://twitter.com/user-givenname"]}], "ims"=>[{"type"=>["yahoo"], "value"=>["some-name2003"]} {"type"=>["gtalk"], "value"=>["some-name2003"]}, {"type"=>["skype"], "value"=>["user-givenname"]}], "emails"=>[{"primary"=>["true"], "value"=>["some-name2003@gmail.com"]}], "photos">[{"type"=>["thumbnail"], "value"=>["http://2.gravatar.com/avatar/6fadss14cea0167256804121f81c33d5fbb"]}, {"value"=>["http://2.gravatar.com/userimage/5146707/c647651ea2579f4900cc05f766a3b23"]}], "id"=>["5146707"], "accounts"=>[{"shortname"=>["facebook"], "url"=>["http://www.facebook.com/profile.php?id=5523354779"], "username"=>["facebook.com"], "domain"=>[facebook.com"], "display"=>["facebook.com"], "verified"=>["true"]}, {"shortname"=>["linkedin"], "url"=>["http://www.linkedin.com/in/user-givenname"], "username"=>["usernameel"], "domain"=>["linkedin.com"], "display"=>["user-givenname"], "verified"=>["true"]}, {"shortname"=>["twitter"], "url"=>["http://twitter.com/user-givenname"], "username"=>["eerasundaravel"], "domain"=>["twitter.com"], "display"=>["@user-givenname"], "verified"=>["true"]}, {"shortname"=>["wordpress"], "url"=>["http://user-givenname.wordpress.com/", "username"=>["user-givenname.wordpress.com"], "domain"=>["user-givenname.wordpress.com"], "display"=>["user-givenname.wordpress.com"], "verified"=>["true"]}], "currentLocaton"=>["Location1, Country"], "aboutMe"=>["About me text goes here"], "phoneNumbers"=>[{"type"=>["mobile"], "value"=>["9894873774"]}], "profileUrl"=>["http://gravatar.com/user-givenname"]}
|
58
|
+
>> {"name"=>[{"givenName"=>["User-GivenName"], "familyName"=>["FamilyName"], "formatted"=>["User-GivenName Lastname"]}], "requestHash"=>["6fa14cea067256804121f81c33d5fbb"], "preferredUsername"=>["user-givenname"], "displayName"=>["user-givenname"], "thumbnailUrl"=>["http://2.gravatar.com/avatar/6fadss14cea0167256804121f81c3d5fbb"], "hash"=>["6fadss14cea0167256804121f81c33d5fbb"], "urls"=>[{"value"=>["http://in.linkedin.com/pub/abced/8/11b/15"]}, {"title"=>["Ruby on Rails Weblog"], "value"=["http://user-givenname.wordpress.com"]}, {"title"=>["Twitter Account"], "value"=>["http://twitter.com/user-givenname"]}], "ims"=>[{"type"=>["yahoo"], "value"=>["some-name2003"]} {"type"=>["gtalk"], "value"=>["some-name2003"]}, {"type"=>["skype"], "value"=>["user-givenname"]}], "emails"=>[{"primary"=>["true"], "value"=>["some-name2003@gmail.com"]}], "photos">[{"type"=>["thumbnail"], "value"=>["http://2.gravatar.com/avatar/6fadss14cea0167256804121f81c33d5fbb"]}, {"value"=>["http://2.gravatar.com/userimage/5146707/c647651ea2579f4900cc05f766a3b23"]}], "id"=>["5146707"], "accounts"=>[{"shortname"=>["facebook"], "url"=>["http://www.facebook.com/profile.php?id=5523354779"], "username"=>["facebook.com"], "domain"=>[facebook.com"], "display"=>["facebook.com"], "verified"=>["true"]}, {"shortname"=>["linkedin"], "url"=>["http://www.linkedin.com/in/user-givenname"], "username"=>["usernameel"], "domain"=>["linkedin.com"], "display"=>["user-givenname"], "verified"=>["true"]}, {"shortname"=>["twitter"], "url"=>["http://twitter.com/user-givenname"], "username"=>["eerasundaravel"], "domain"=>["twitter.com"], "display"=>["@user-givenname"], "verified"=>["true"]}, {"shortname"=>["wordpress"], "url"=>["http://user-givenname.wordpress.com/", "username"=>["user-givenname.wordpress.com"], "domain"=>["user-givenname.wordpress.com"], "display"=>["user-givenname.wordpress.com"], "verified"=>["true"]}], "currentLocaton"=>["Location1, Country"], "aboutMe"=>["About me text goes here"], "phoneNumbers"=>[{"type"=>["mobile"], "value"=>["9894873774"]}], "profileUrl"=>["http://gravatar.com/user-givenname"]}
|
data/gravatar_profile.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{gravatar_profile}
|
5
|
-
s.version = "1.0"
|
5
|
+
s.version = "1.2.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Veerasundaravel Thirugnanasundaram"]
|
9
|
-
s.date = %q{2010-
|
9
|
+
s.date = %q{2010-09-07}
|
10
10
|
s.description = %q{gravatar_profile is a Ruby Wrapper for getting GRAVATAR[http://gravatar.com] avatars and profile informations.}
|
11
11
|
s.email = ["veerasundaravel@gmail.com"]
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.rdoc", ]
|
13
|
-
s.files = ["CHANGELOG.rdoc", "README.rdoc", "gravatar_profile.gemspec", "lib/gravatar_profile.rb"]
|
13
|
+
s.files = ["CHANGELOG.rdoc", "README.rdoc", "MIT-LICENSE", "gravatar_profile.gemspec", "lib/gravatar_profile.rb"]
|
14
14
|
s.homepage = %q{http://veerasundaravel.wordpress.com}
|
15
15
|
s.rdoc_options = ["--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
data/lib/gravatar_profile.rb
CHANGED
@@ -54,7 +54,7 @@ class GravatarProfile
|
|
54
54
|
|
55
55
|
url = URI.parse("http://en.gravatar.com")
|
56
56
|
res = Net::HTTP::Proxy(proxy_host, proxy_port).start(url.host, url.port) {|http|
|
57
|
-
http.get(gravatar_profilename(
|
57
|
+
http.get(gravatar_profilename(:xml))
|
58
58
|
}
|
59
59
|
|
60
60
|
if res.msg == "OK"
|
metadata
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gravatar_profile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 1
|
8
|
+
- 2
|
7
9
|
- 0
|
8
|
-
version:
|
10
|
+
version: 1.2.0
|
9
11
|
platform: ruby
|
10
12
|
authors:
|
11
13
|
- Veerasundaravel Thirugnanasundaram
|
@@ -13,16 +15,18 @@ autorequire:
|
|
13
15
|
bindir: bin
|
14
16
|
cert_chain: []
|
15
17
|
|
16
|
-
date: 2010-
|
18
|
+
date: 2010-09-07 00:00:00 +05:30
|
17
19
|
default_executable:
|
18
20
|
dependencies:
|
19
21
|
- !ruby/object:Gem::Dependency
|
20
22
|
name: xml-simple
|
21
23
|
prerelease: false
|
22
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 23
|
26
30
|
segments:
|
27
31
|
- 1
|
28
32
|
- 0
|
@@ -43,6 +47,7 @@ extra_rdoc_files:
|
|
43
47
|
files:
|
44
48
|
- CHANGELOG.rdoc
|
45
49
|
- README.rdoc
|
50
|
+
- MIT-LICENSE
|
46
51
|
- gravatar_profile.gemspec
|
47
52
|
- lib/gravatar_profile.rb
|
48
53
|
has_rdoc: true
|
@@ -56,23 +61,27 @@ rdoc_options:
|
|
56
61
|
require_paths:
|
57
62
|
- lib
|
58
63
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
59
65
|
requirements:
|
60
66
|
- - ">="
|
61
67
|
- !ruby/object:Gem::Version
|
68
|
+
hash: 3
|
62
69
|
segments:
|
63
70
|
- 0
|
64
71
|
version: "0"
|
65
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
66
74
|
requirements:
|
67
75
|
- - ">="
|
68
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 3
|
69
78
|
segments:
|
70
79
|
- 0
|
71
80
|
version: "0"
|
72
81
|
requirements: []
|
73
82
|
|
74
83
|
rubyforge_project: gravatar_profile
|
75
|
-
rubygems_version: 1.
|
84
|
+
rubygems_version: 1.4.2
|
76
85
|
signing_key:
|
77
86
|
specification_version: 1
|
78
87
|
summary: gravatar_profile is a Ruby Wrapper for getting GRAVATAR[http://gravatar.com] avatars and profile informations. by Veerasundaravel Thirugnanasundaram
|