bloggerapi 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcaa18dc78fb22576f6ef7a25f8f49174f08c63d
4
- data.tar.gz: ff76be3def1d5484961c06e81391f2a3841d1793
3
+ metadata.gz: b42aeac4bcf227b574c639a9014a712a2ad4c358
4
+ data.tar.gz: 7f6d156f6553ac8ecfb86cd20608b69874c9a9f2
5
5
  SHA512:
6
- metadata.gz: 60605128996c9f78091260c59b8f43f0cd033f87f60c60e61eb9c16871c2296690d70d504bbb00000cc345d4edd6f266c77d5506b9a80b5c8bad7853e6e8e546
7
- data.tar.gz: ed9aff03dfcb3a2cb7c50c52985f117a9f9321d65e7c245927ccb0a93e55304cec34fc8e3a8e96846ec5a29e4e6adeead3b35515ae07dd03073eb3dff3a7b17e
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
- Still on Development
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
@@ -1,5 +1,2 @@
1
1
  require "blogger/version"
2
-
3
- module Blogger
4
- # Your code goes here...
5
- end
2
+ require "blogger/configuration"
@@ -0,0 +1,13 @@
1
+ require 'blogger/post'
2
+
3
+ module Blogger
4
+ class Configuration
5
+ include Blogger::GetPosts
6
+ attr_accessor :key, :max_result, :blog_id
7
+
8
+ def initialize
9
+ yield(self) if block_given?
10
+ end
11
+
12
+ end
13
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Blogger
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-03-28 00:00:00.000000000 Z
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.1.gem
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