googleplus-reader 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2de1653bedcdeab3a7934dd51de3e68de01326c1
|
4
|
+
data.tar.gz: c2d9bb8ce038fe246429d6ea8b5e5a2b9cbdbf71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f67cd24f00d31c136e8b8efb46bd45660187ac985e758e89ec783f26048e3421242b267bebd62f509ec4e7f588d0d573f2bf87d96006b41b049c3821c90332d1
|
7
|
+
data.tar.gz: 6829f86dbd21d0d30646f3713c97f2254977a74cadd505250d2cee20d5df13e20134d3e993e721e18731249ec4c31d6e106fbcf0375f91252b5d782effbcf984
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## GooglePlus Reader 0.1.0 (June 16, 2016)
|
2
|
+
|
3
|
+
* Changed the `url` attribute of a photo to contain the URL of the original
|
4
|
+
image instead of the URL of the preview image, which is now in `preview_url`.
|
5
|
+
|
6
|
+
* Changed the `load` method of a photo to load the original image if no size
|
7
|
+
requirement has been specified.
|
8
|
+
|
1
9
|
## GooglePlus Reader 0.0.7 (December 5, 2014)
|
2
10
|
|
3
11
|
* Added `activity_id` to the attributes of a photo.
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
# GooglePlus Reader [![Gem Version]
|
1
|
+
# GooglePlus Reader [![Gem Version][fury-svg]][fury-url]
|
2
2
|
|
3
3
|
The library provides an interface for reading public activities of a
|
4
4
|
[Google+](https://plus.google.com) user. A life demo can be found
|
5
|
-
[here](
|
6
|
-
[here](https://github.com/IvanUkhov/
|
5
|
+
[here](https://photos.ivanukhov.com) and its source code
|
6
|
+
[here](https://github.com/IvanUkhov/photos). Best enjoyed responsibly.
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
@@ -60,8 +60,8 @@ reader.next(5).done (posts) ->
|
|
60
60
|
|
61
61
|
Here `user_id` is the identifier of a Google+ user, and `api_key` is your
|
62
62
|
[Google+ API key](https://developers.google.com/+/api/oauth). `post` is exactly
|
63
|
-
what Google has to say about each post without any additional preprocessing.
|
64
|
-
|
63
|
+
what Google has to say about each post without any additional preprocessing. You
|
64
|
+
might want to inspect it and fetch what is needed for your application.
|
65
65
|
|
66
66
|
A more interesting example with photos that a user publishes:
|
67
67
|
|
@@ -78,8 +78,8 @@ reader.next(5).done (photos) ->
|
|
78
78
|
|
79
79
|
`photo` is an instance of `GooglePlus.Photo`. Right now, `attributes` contains
|
80
80
|
only `url`, `date`, and `width` (if available), but other parameters can be
|
81
|
-
easily added via a pull request >:)~ The only method that `photo` has is
|
82
|
-
|
81
|
+
easily added via a pull request >:)~ The only method that `photo` has is `load`,
|
82
|
+
which can be used as follows:
|
83
83
|
|
84
84
|
```coffee
|
85
85
|
photo.load().done (element) ->
|
@@ -101,3 +101,6 @@ loaded.
|
|
101
101
|
1. Fork the project.
|
102
102
|
2. Implement your idea.
|
103
103
|
3. Create a pull request.
|
104
|
+
|
105
|
+
[fury-svg]: https://badge.fury.io/rb/googleplus-reader.svg
|
106
|
+
[fury-url]: http://badge.fury.io/rb/googleplus-reader
|
data/googleplus-reader.gemspec
CHANGED
@@ -15,6 +15,6 @@ Gem::Specification.new do |spec|
|
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
17
17
|
|
18
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
19
|
-
spec.add_development_dependency 'rake', '~>
|
18
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
19
|
+
spec.add_development_dependency 'rake', '~> 11.2'
|
20
20
|
end
|
@@ -10,22 +10,7 @@ define 'googleplus.photo', ['jquery'], ($) ->
|
|
10
10
|
load: (options = {}) ->
|
11
11
|
deferred = $.Deferred()
|
12
12
|
|
13
|
-
width = options.width if options.width?
|
14
|
-
|
15
|
-
if @attributes.width?
|
16
|
-
if width?
|
17
|
-
width = Math.min(width, @attributes.width)
|
18
|
-
else
|
19
|
-
width = @attributes.width
|
20
|
-
|
21
|
-
if width?
|
22
|
-
width = Math.round(width)
|
23
|
-
url = @attributes.url.replace(/w\d+-h\d+(-p)?/, "w#{width}")
|
24
|
-
else
|
25
|
-
url = @attributes.url
|
26
|
-
|
27
13
|
element = $('<img/>')
|
28
|
-
|
29
14
|
element
|
30
15
|
.on 'load', ->
|
31
16
|
element.off('load error')
|
@@ -37,6 +22,16 @@ define 'googleplus.photo', ['jquery'], ($) ->
|
|
37
22
|
deferred.reject(details...)
|
38
23
|
return
|
39
24
|
|
40
|
-
element.attr(src: url)
|
25
|
+
element.attr(src: @url(options))
|
41
26
|
|
42
27
|
deferred.promise()
|
28
|
+
|
29
|
+
url: (options = {}) ->
|
30
|
+
if options.width? and @attributes.preview_url?
|
31
|
+
width = options.width
|
32
|
+
width = Math.min(width, @attributes.width) if @attributes.width?
|
33
|
+
width = Math.round(width)
|
34
|
+
@attributes.preview_url.replace(/w\d+-h\d+(-p)?/, "w#{width}")
|
35
|
+
|
36
|
+
else
|
37
|
+
@attributes.url or @attributes.preview_url
|
@@ -29,15 +29,17 @@ define 'googleplus.photoreader', ['googleplus.reader', 'googleplus.photo'], (Rea
|
|
29
29
|
if attachment.fullImage?
|
30
30
|
collection.push new Photo
|
31
31
|
activity_id: item.id,
|
32
|
-
|
32
|
+
date: date,
|
33
|
+
url: attachment.fullImage.url,
|
33
34
|
width: attachment.fullImage.width,
|
34
|
-
|
35
|
+
height: attachment.fullImage.height,
|
36
|
+
preview_url: attachment.image.url,
|
37
|
+
|
35
38
|
else
|
36
39
|
collection.push new Photo
|
37
40
|
activity_id: item.id,
|
38
|
-
|
39
|
-
|
40
|
-
date: date
|
41
|
+
date: date,
|
42
|
+
preview_url: attachment.image.url,
|
41
43
|
|
42
44
|
else if attachment.objectType is 'album'
|
43
45
|
continue unless attachment.thumbnails?
|
@@ -47,8 +49,7 @@ define 'googleplus.photoreader', ['googleplus.reader', 'googleplus.photo'], (Rea
|
|
47
49
|
|
48
50
|
collection.push new Photo
|
49
51
|
activity_id: item.id,
|
50
|
-
|
51
|
-
|
52
|
-
date: date
|
52
|
+
date: date,
|
53
|
+
preview_url: thumbnail.image.url,
|
53
54
|
|
54
55
|
collection
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: googleplus-reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Ukhov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.12'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.12'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '11.2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '11.2'
|
41
41
|
description: The library provides an interface for reading public activities of a
|
42
42
|
Google+ user.
|
43
43
|
email:
|
@@ -78,8 +78,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.
|
81
|
+
rubygems_version: 2.5.1
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: A jQuery-based library for reading Google+ activities
|
85
85
|
test_files: []
|
86
|
+
has_rdoc:
|