g_ruby 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/g_ruby/reader.rb +49 -0
  3. data/lib/g_ruby.rb +2 -1
  4. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93390e5ec73db632c31f423ec3efc99bcbd64d09
4
- data.tar.gz: 20da34e0fe5552b8c17bdf02541fad6623c24792
3
+ metadata.gz: 2b0302b7251b089963fdf92a27c93c96977e4b13
4
+ data.tar.gz: 14779a226267e728f6edfbfbb22ebcba262866b9
5
5
  SHA512:
6
- metadata.gz: 215a95462860572f39d2499e2d907cb8b40c2e6d4508945583517489b4d8bda1613091cc4d69def63f99c2d18fac048e7fc243df123aa2ff17bb2832fd3330fc
7
- data.tar.gz: be4e118be18f2d221cf285c0cc6cc044dabb59b518ba31cf23e331ce21d5aaf90ac73756ffbea2be0b42d9b38ceb353e0e15f33a3a45b5f9fe40b204d0f9cab3
6
+ metadata.gz: e8854a5f5749d85bebcd74b7b5ae5aec19e95d4795bd87afd4375940c88d54fdf6bc0da1faafb99c7fb9beb1c47f9915addcdb2ef3aab6d7dc31292bbbe3d9f4
7
+ data.tar.gz: cebf6444575b62da729051f3ed96a14d1344c1791b498e32860c84201a813cc12b908714c15fbaaf7d27219663a0621974e8e144dc84c5f0d3c329b2c5c6c3cf
@@ -0,0 +1,49 @@
1
+ class GRuby::Reader
2
+
3
+ require 'g_ruby/util'
4
+
5
+ #GRuby::Reader.subscriptions(at)
6
+ def self.subscriptions(at)
7
+ url = "https://www.google.com/reader/api/0/subscription/list?output=json&access_token=#{at}"
8
+ a = GRuby::Util.get_json(Nestful.get(url))
9
+ response_obj = []
10
+ if !a.blank?
11
+ if !a["subscriptions"].blank?
12
+ if !a["subscriptions"].first.blank?
13
+ a["subscriptions"].each do |s|
14
+ tags = []
15
+ if !s["categories"].blank?
16
+ if !s["categories"].first.blank?
17
+ s["categories"].each do |t|
18
+ tags << t["label"]
19
+ end
20
+ end
21
+ end
22
+ response_obj << [s["id"], s["title"], s["htmlUrl"], s["categories"], s["sortid"], tags]
23
+ end
24
+ end
25
+ end
26
+ end
27
+ return response_obj
28
+ end
29
+
30
+ #GRuby::Reader.tags(at)
31
+ def self.tags(at)
32
+ url = "https://www.google.com/reader/api/0/tag/list?output=json&access_token=#{at}"
33
+ a = GRuby::Util.get_json(Nestful.get(url))
34
+ response_obj = []
35
+ if !a.blank?
36
+ if !a["tags"].blank?
37
+ if !a["tags"].first.blank?
38
+ a["tags"].each do |t|
39
+ g = t["id"].split("/")
40
+ g = g[g.count-1]
41
+ response_obj << [g, t["sortid"]]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ return response_obj
47
+ end
48
+
49
+ end
data/lib/g_ruby.rb CHANGED
@@ -5,4 +5,5 @@ end
5
5
  require 'nestful'
6
6
  require 'nokogiri'
7
7
  require 'g_ruby/auth'
8
- require 'g_ruby/analytics'
8
+ require 'g_ruby/analytics'
9
+ require 'g_ruby/reader'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pykih Software
@@ -48,6 +48,7 @@ files:
48
48
  - lib/g_ruby/analytics.rb
49
49
  - lib/g_ruby/auth.rb
50
50
  - lib/g_ruby/util.rb
51
+ - lib/g_ruby/reader.rb
51
52
  homepage: https://github.com/pykih/g_ruby
52
53
  licenses: []
53
54
  metadata: {}