<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,5 +2,17 @@
 TWSMS is a SMS Service Company in Taiwan.
 And TWSMSR is a sender library for Ruby to easy use SMS service.
 
+= Usage
+
+require 'twsmsr'
+t = TWSMSR.new(username, password)
+resp = t.send(tel, message) # Get response, if resp is less than 0, it means it got an error! If response is greater than 0, that means the response is the message id.
+puts t.query # Get error check.
+puts t.message_id # Get message id.
+t.message_id = &quot;123456&quot; # Set Message ID
+puts t.query
+
+
+
 = Support
 You can mail to CFC (cfcsky@gmail.com) to report issues.
\ No newline at end of file</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -71,25 +71,29 @@ class TWSMSR
   end
   
   def query
+    options = @query_options
     url ||= @@QUERY_URL + &quot;username=&quot; + @uname + &quot;&amp;password=&quot; + @upwd
     url += &quot;&amp;type=&quot; + @query_options[:type].to_s
-    url += &quot;&amp;msgid=&quot; + @query_options[:msgid].to_s
-    url += &quot;&amp;monumber=&quot; + @query_options[:monumber].to_s
-    url += &quot;&amp;sdate=&quot; + @query_options[:sdate].to_s
-    url += &quot;&amp;edate=&quot; + @query_options[:edate].to_s
+    url += &quot;&amp;msgid=&quot; + @query_options[:msgid].to_s if options[:type].to_s =~ /^(now|dlv(del)?)$/
+    url += &quot;&amp;monumber=&quot; + @query_options[:monumber].to_s if options[:type].to_s =~ /^mo$/
+    url += &quot;&amp;sdate=&quot; + @query_options[:sdate].to_s if options[:type].to_s =~ /^backpoint$/
+    url += &quot;&amp;edate=&quot; + @query_options[:edate].to_s if options[:type].to_s =~ /^backpoint$/
     
     unless self.check_date(&quot;sdate&quot;) || self.check_date(&quot;edate&quot;)
-      raise ArgumentError, &quot;dlvtime is invalid.&quot;
+      raise ArgumentError, &quot;sdate or edate is invalid.&quot;
       return false
-    end
+    end if @query_options[:type].to_s =~ /backpoint/
     
     return self.check_response(Net::HTTP.get(URI.parse(url)), &quot;query&quot;)
   end
-
-  def setMessageId(msgid)
-    raise ArgumentError, &quot;No Message ID given.&quot; if msgid.nil?
+  
+  def message_id
+    return @query_options[:msgid].to_s
+  end
+  
+  def message_id=(msgid)
     @query_options[:msgid] = msgid
-    return nil
+    return true
   end
   
   protected</diff>
      <filename>lib/twsmsr.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a9c7b58cebf3c418a1e03fb9b95254e5ad80d6e3</id>
    </parent>
  </parents>
  <author>
    <name>CFC</name>
    <email>zusocfc@gmail.com</email>
  </author>
  <url>http://github.com/cfc/twsmsr/commit/8988811bd215c3cd07b152813f13e4ec4552d3a7</url>
  <id>8988811bd215c3cd07b152813f13e4ec4552d3a7</id>
  <committed-date>2009-01-18T02:48:17-08:00</committed-date>
  <authored-date>2009-01-18T02:48:17-08:00</authored-date>
  <message>Fix some bug and edit README.</message>
  <tree>bf97c7da966a8aeccb3a98b13da89faf84480358</tree>
  <committer>
    <name>CFC</name>
    <email>zusocfc@gmail.com</email>
  </committer>
</commit>
