fmylife 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/lib/fmylife.rb +3 -4
- metadata +1 -1
data/History.txt
CHANGED
data/lib/fmylife.rb
CHANGED
@@ -41,7 +41,7 @@ require File.dirname(__FILE__)+'/xmlstruct.rb'
|
|
41
41
|
# See the individual docs for more examples.
|
42
42
|
#
|
43
43
|
module FMyLife
|
44
|
-
VERSION = '0.5.
|
44
|
+
VERSION = '0.5.1'
|
45
45
|
|
46
46
|
API_ROOT = 'api.betacie.com'
|
47
47
|
SANDBOX_ROOT = 'sandbox.betacie.com'
|
@@ -75,7 +75,7 @@ module FMyLife
|
|
75
75
|
def self.parser
|
76
76
|
@@parser
|
77
77
|
end
|
78
|
-
|
78
|
+
self.parser = :rexml
|
79
79
|
|
80
80
|
# = Account
|
81
81
|
# An account/connection to FMyLife.com. This class provides access to all of the
|
@@ -239,6 +239,7 @@ module FMyLife
|
|
239
239
|
raise FMyLife::AuthenticationError.new("You aren't logged in.") if @auth_token.nil?
|
240
240
|
params = (story.is_a? FMyLife::Story) ? {:author => story.author, :text => story.text, :cat => story.category} : story
|
241
241
|
params[:cat] = params.delete :category if params[:category]
|
242
|
+
params[:cat] = :miscellaneous if params[:cat].to_s =~ /misc/
|
242
243
|
raise FMyLife::StoryTooLongError.new("Stories can be no longer than 300 characters.") if params[:text].size > 300
|
243
244
|
params[:token] = @auth_token
|
244
245
|
path = "/submit"
|
@@ -361,7 +362,6 @@ module FMyLife
|
|
361
362
|
query_params.merge!(:key => @api_key, :language => @language)
|
362
363
|
http = Net::HTTP.new((@sandbox_mode) ? SANDBOX_ROOT : API_ROOT)
|
363
364
|
path = path + "?" + URI.escape(query_params.map {|k,v| "#{k}=#{v}"}.join("&"), /[^-_!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]/n)
|
364
|
-
puts path
|
365
365
|
resp = http.get(path)
|
366
366
|
xml_doc(resp.body)
|
367
367
|
end
|
@@ -385,7 +385,6 @@ module FMyLife
|
|
385
385
|
|
386
386
|
# Helper method that finds the error string from an XML document from fmylife
|
387
387
|
def error(doc)
|
388
|
-
puts doc.inspect
|
389
388
|
begin
|
390
389
|
xml_content xpath(doc,'//error').first
|
391
390
|
rescue
|