grapi 0.3.0 → 0.4.0

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/grapi.gemspec +2 -2
  3. data/lib/grapi/reader.rb +13 -4
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
data/grapi.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{grapi}
8
- s.version = "0.3.0"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aurelian Oancea"]
12
- s.date = %q{2009-12-29}
12
+ s.date = %q{2010-01-04}
13
13
  s.description = %q{Ruby client for unofficial Google Reader API}
14
14
  s.email = %q{oancea@gmail.com}
15
15
  s.extra_rdoc_files = [
data/lib/grapi/reader.rb CHANGED
@@ -40,8 +40,11 @@ module Grapi
40
40
  edit_subscription "feed/#{feed_url}", "subscribe", {"a" => "user/-/label/#{label}"}
41
41
  end
42
42
 
43
- def mark_as_read(entry_id)
44
- post_with_token "http://www.google.com/reader/api/0/edit-tag", {"i" => entry_id, "a" => "user/-/state/com.google/read"}
43
+ def mark_as_read(entry_ids)
44
+ Array(entry_ids).map{|e|e.to_s}.slice(999).each do | slice |
45
+ post_with_token "http://www.google.com/reader/api/0/edit-tag", {"i" => slice, "a" => "user/-/state/com.google/read"}
46
+ end
47
+ self
45
48
  end
46
49
 
47
50
  # options:
@@ -66,8 +69,14 @@ module Grapi
66
69
  end
67
70
 
68
71
  def post(url, params)
69
- curl_post_params= params.inject([]){|p, e| p << ::Curl::PostField.content(e[0],e[1])}
70
- make_request(url){|c| c.http_post(*curl_post_params)}
72
+ post_data= params.inject([]) do |memo, current|
73
+ memo<< if current[1].kind_of? Array
74
+ current[1].map{|it| ::Curl::PostField.content(current[0], it)}
75
+ else
76
+ ::Curl::PostField.content(current[0], current[1])
77
+ end
78
+ end
79
+ make_request(url){|c| c.http_post(*post_data)}
71
80
  end
72
81
 
73
82
  def post_with_token(url, params)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aurelian Oancea
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-29 00:00:00 +01:00
12
+ date: 2010-01-04 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency