doubapi 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Doubapi
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/doubapi.rb CHANGED
@@ -41,7 +41,7 @@ module Doubapi
41
41
  #use Douban API
42
42
  Event = Struct.new :title, :when, :where, :what,:link,:poster_mobile,:bar_icon
43
43
  #release_date is in the format of YY-MM-DD
44
- Album = Struct.new :author, :title, :release_date, :link,:cover_thumbnail,:publisher,:mobile_site
44
+ Album = Struct.new :author, :title, :release_date, :link,:cover_thumbnail,:cover_big,:publisher,:mobile_site
45
45
 
46
46
  #input:{key => "all/singer_name", :location => "shanghai", :start_index => 16,:max_result => 15}
47
47
  #return total number of events satisfying the search criterion
@@ -201,6 +201,13 @@ def search_albums_of h
201
201
  #link - pc web
202
202
  link = entry.at_xpath(".//link[@rel='alternate']")["href"]
203
203
  cover_thumnail = entry.at_xpath(".//link[@rel='image']")["href"]
204
+
205
+ #cover big
206
+ #example:
207
+ #thumbnail http://img1.douban.com/spic/s1461123.jpg
208
+ #big http://img1.douban.com/lpic/s1461123.jpg
209
+ cover_big = cover_thumnail.gsub("spic","lpic");
210
+
204
211
  #publisher
205
212
  pubItem = entry.at_xpath(".//attribute[@name='publisher']")
206
213
  publisher = if pubItem.nil? then "unknow" else pubItem.text end
@@ -212,7 +219,7 @@ def search_albums_of h
212
219
  formated_release_day = formate_release_date(release_date)
213
220
  #check the release date
214
221
  if compare_date release_date, after_date
215
- albums << Doubapi::Album.new(author, title, formated_release_day, link, cover_thumnail,publisher,mobile_site)
222
+ albums << Doubapi::Album.new(author, title, formated_release_day, link, cover_thumnail,cover_big ,publisher,mobile_site)
216
223
  end
217
224
  end
218
225
  #improve ME
data/lib/test.rb CHANGED
@@ -109,6 +109,6 @@ end
109
109
 
110
110
  #test_get_all_events
111
111
  #test1
112
- #test2
112
+ test2
113
113
  #test4
114
- test5
114
+ #test5
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doubapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: