1
0
Fork 0
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:
John Nunemaker 2008-07-31 00:29:17 -04:00
parent 72f09186e8
commit 3a9b0b1b39
2 changed files with 21 additions and 14 deletions

View file

@ -31,12 +31,13 @@ That works and all but what if you don't want to embed your username and passwor
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

View file

@ -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
@ -67,11 +69,15 @@ Twitter.new('username', 'password').post("It's an HTTParty and everyone is invit
</div> </div>
</div> </div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> <script type="text/javascript">
<script type="text/javascript">_uacct = "UA-85301-9"; urchinTracker();</script> 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>
<!-- 103bees.com 'bee' code v1.11 - please do not make any changes! -->
<script type="text/javascript" src="http://103bees.com/bees/?bee=3672&amp;fid=5643"></script>
<!-- 103bees.com 'bee' code -->
</body> </body>
</html> </html>