bloggerapi 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -1
- data/bloggerapi-0.0.2.gem +0 -0
- data/lib/blogger.rb +1 -4
- data/lib/blogger/configuration.rb +13 -0
- data/lib/blogger/post.rb +12 -0
- data/lib/blogger/version.rb +1 -1
- metadata +5 -3
- data/bloggerapi-0.0.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b42aeac4bcf227b574c639a9014a712a2ad4c358
|
4
|
+
data.tar.gz: 7f6d156f6553ac8ecfb86cd20608b69874c9a9f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c27f1a523ed02adb5113234642e5074e37a91a911d83c86eed8a949f255da99456e42239ade22283fcd35ed7d4613d24ce7910b714da41e043cbebf234a1dd6c
|
7
|
+
data.tar.gz: ebf981ed0660d71c82022fe7d5c38b34c7615d3b395550962606a4f1146b55967ac0988ec21a5606a73b7e2b03f614b1df49d6a757bf3600932988131ee27610
|
data/README.md
CHANGED
@@ -2,7 +2,45 @@
|
|
2
2
|
|
3
3
|
Blogger API implementation for Ruby
|
4
4
|
|
5
|
-
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'bloggerapi'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install bloggerapi
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
First of all
|
24
|
+
|
25
|
+
`require 'Blogger' `
|
26
|
+
|
27
|
+
Initialize `Blogger::Configuration` object with your API Key
|
28
|
+
|
29
|
+
Configuration
|
30
|
+
```ruby
|
31
|
+
@blogger = Blogger::Configuration.new do |config|
|
32
|
+
config.key = "YOUR_API_KEY"
|
33
|
+
config.max_result = 100
|
34
|
+
config.blog_id = "BLOG_ID" //Blog id to get posts
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
Then fetch posts for the relevent blog
|
39
|
+
```ruby
|
40
|
+
posts = @blogger.get_blogposts
|
41
|
+
```
|
42
|
+
|
43
|
+
Posts is an array containing list of Blog posts.
|
6
44
|
|
7
45
|
## Development
|
8
46
|
|
Binary file
|
data/lib/blogger.rb
CHANGED
data/lib/blogger/post.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'http'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module Blogger
|
5
|
+
module GetPosts
|
6
|
+
|
7
|
+
def get_blogposts
|
8
|
+
response = HTTP.get("https://www.googleapis.com/blogger/v3/blogs/#{blog_id}/posts?maxResults=#{@max_result}&key=#{key}")
|
9
|
+
@json_response = JSON.parse(response.to_s)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/blogger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bloggerapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dilum Navanjana
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,8 +70,10 @@ files:
|
|
70
70
|
- bin/console
|
71
71
|
- bin/setup
|
72
72
|
- blogger.gemspec
|
73
|
-
- bloggerapi-0.0.
|
73
|
+
- bloggerapi-0.0.2.gem
|
74
74
|
- lib/blogger.rb
|
75
|
+
- lib/blogger/configuration.rb
|
76
|
+
- lib/blogger/post.rb
|
75
77
|
- lib/blogger/version.rb
|
76
78
|
homepage: https://github.com/dilumn/blogger
|
77
79
|
licenses:
|
data/bloggerapi-0.0.1.gem
DELETED
Binary file
|