mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
Updated readme and website.
This commit is contained in:
parent
72f09186e8
commit
3a9b0b1b39
2 changed files with 21 additions and 14 deletions
11
README.txt
11
README.txt
|
@ -30,13 +30,14 @@ That works and all but what if you don't want to embed your username and passwor
|
||||||
class Twitter
|
class Twitter
|
||||||
include HTTParty
|
include HTTParty
|
||||||
base_uri 'twitter.com'
|
base_uri 'twitter.com'
|
||||||
|
|
||||||
def initialize(user, pass)
|
def initialize(u, p)
|
||||||
self.class.basic_auth user, pass
|
@auth = {:username => u, :password => p}
|
||||||
end
|
end
|
||||||
|
|
||||||
def post(text)
|
def post(text)
|
||||||
self.class.post('/statuses/update.json', :query => {:status => text})
|
options = { :query => {:status => text}, :basic_auth => @auth }
|
||||||
|
self.class.post('/statuses/update.json', options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<ul id="nav">
|
<ul id="nav">
|
||||||
<li><a href="rdoc/">Docs</a></li>
|
<li><a href="rdoc/">Docs</a></li>
|
||||||
<li><a href="http://github.com/jnunemaker/httparty">Github</a></li>
|
<li><a href="http://github.com/jnunemaker/httparty">Github</a></li>
|
||||||
|
<li><a href="http://jnunemaker.lighthouseapp.com/projects/14842-httparty/tickets">Lighthouse</a></li>
|
||||||
<li><a href="http://rubyforge.org/projects/httparty/">Rubyforge</a></li>
|
<li><a href="http://rubyforge.org/projects/httparty/">Rubyforge</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,12 +44,13 @@ Twitter.post('/statuses/update.json', :query => {:status => "It's an HTTParty an
|
||||||
include HTTParty
|
include HTTParty
|
||||||
base_uri 'twitter.com'
|
base_uri 'twitter.com'
|
||||||
|
|
||||||
def initialize(user, pass)
|
def initialize(u, p)
|
||||||
self.class.basic_auth user, pass
|
@auth = {:username => u, :password => p}
|
||||||
end
|
end
|
||||||
|
|
||||||
def post(text)
|
def post(text)
|
||||||
self.class.post('/statuses/update.json', :query => {:status => text})
|
options = { :query => {:status => text}, :basic_auth => @auth }
|
||||||
|
self.class.post('/statuses/update.json', options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -66,12 +68,16 @@ Twitter.new('username', 'password').post("It's an HTTParty and everyone is invit
|
||||||
<p>Created by <a href="http://addictedtonew.com/about/">John Nunemaker</a></p>
|
<p>Created by <a href="http://addictedtonew.com/about/">John Nunemaker</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||||
|
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var pageTracker = _gat._getTracker("UA-85301-19");
|
||||||
|
pageTracker._initData();
|
||||||
|
pageTracker._trackPageview();
|
||||||
|
</script>
|
||||||
|
|
||||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
|
|
||||||
<script type="text/javascript">_uacct = "UA-85301-9"; urchinTracker();</script>
|
|
||||||
|
|
||||||
<!-- 103bees.com 'bee' code v1.11 - please do not make any changes! -->
|
|
||||||
<script type="text/javascript" src="http://103bees.com/bees/?bee=3672&fid=5643"></script>
|
|
||||||
<!-- 103bees.com 'bee' code -->
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in a new issue