Permalink
Browse files

updated html site; added d method for direct messaging but commented …

…it out as api doesn't seem to work

git-svn-id: http://svn.addictedtonew.com/public/gems/twitter@48 fe7eae16-9a24-0410-a59d-9e59979e88be
  • Loading branch information...
1 parent ab943d0 commit 13e031f8d2e8db6ca8ace18a25886fb690d580d2 jnunemaker committed Apr 1, 2007
Showing with 20 additions and 2 deletions.
  1. +3 −0 CHANGELOG
  2. +1 −0 html/index.html
  3. +16 −2 lib/twitter/base.rb
View
@@ -1,4 +1,7 @@
0.1.0 - March 31, 2007
+ * added d method for creating direct messages (waiting for it to work as documented)
+ * added featured method for getting featured users statuses (waiting for it to work as documented)
+ * added direct_messages method
* added friends_for method
* added a few tests
* removed relative_created_at as it is deprecated
View
@@ -97,6 +97,7 @@ <h2>API Wrapping</h2>
<h2>Uses</h2>
<ul>
+ <li><a href="http://snitch.rubyforge.org">Snitch</a></li>
<li><a href="http://al3x.net/entries/766">Growl + Twitter</a></li>
<li><a href="http://snippets.dzone.com/posts/show/3714">Twitter Woot Bot</a> (<a href="http://soylentfoo.jnewland.com/articles/2007/03/22/woot-twitter-bot-now-official">more here</a>)</li>
<li><a href="http://soylentfoo.jnewland.com/articles/2007/01/22/tweet-update-twitter-via-quicksilver">Tweet Quicksilver Action</a></li>
View
@@ -50,6 +50,7 @@ def followers
end
# waiting for twitter to correclty implement this in the api as it is documented
+ # TODO: uncomment this when it is working
# def featured
# users(call(:featured))
# end
@@ -62,6 +63,19 @@ def direct_messages(since=nil)
(doc/:direct_message).inject([]) { |dms, dm| dms << DirectMessage.new_from_xml(dm); dms }
end
+ # This api methods doesn't seem to be working
+ # TODO: uncomment this when it is working
+ # def d(user, msg)
+ # url = URI.parse("http://#{@@api_url}/statuses/update.xml")
+ #
+ # req = Net::HTTP::Post.new(url.path)
+ # req.basic_auth(@config[:email], @config[:password])
+ # req.set_form_data({'user' => user, 'msg' => msg})
+ #
+ # response = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }
+ # puts response.message,response.body
+ # end
+
# Updates your twitter with whatever status string is passed in
def post(status)
url = URI.parse("http://#{@@api_url}/statuses/update.xml")
@@ -70,8 +84,8 @@ def post(status)
req.basic_auth(@config[:email], @config[:password])
req.set_form_data({'status' => status})
- result = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }
- Status.new_from_xml(parse(result.body).at('status'))
+ response = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }
+ Status.new_from_xml(parse(response.body).at('status'))
end
alias :update :post

0 comments on commit 13e031f

Please sign in to comment.