Skip to content
Browse files

Added website files

  • Loading branch information...
1 parent 06c0463 commit b70ce56092dd355b2dc73f0151861099bc81cfb2 @jnunemaker committed Jul 29, 2008
Showing with 124 additions and 0 deletions.
  1. +47 −0 website/css/common.css
  2. +77 −0 website/index.html
View
47 website/css/common.css
@@ -0,0 +1,47 @@
+@media screen, projection {
+ /*
+ Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ Code licensed under the BSD License:
+ http://developer.yahoo.net/yui/license.txt
+ version: 2.2.0
+ */
+ body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}
+ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}/*ol,ul {list-style:none;}*/caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
+ /* end of yahoo reset and fonts */
+
+ body {color:#333; background:#4b1a1a; line-height:1.3;}
+ p {margin:0 0 20px;}
+ a {color:#4b1a1a;}
+ a:hover {text-decoration:none;}
+ strong {font-weight:bold;}
+ em {font-style:italics;}
+ h1,h2,h3,h4,h5,h6 {font-weight:bold;}
+ h1 {font-size:197%; margin:30px 0; color:#4b1a1a;}
+ h2 {font-size:174%; margin:20px 0; color:#b8111a;}
+ h3 {font-size:152%; margin:10px 0;}
+ h4 {font-size:129%; margin:10px 0;}
+ pre {background:#eee; margin:0 0 20px; padding:20px; border:1px solid #ccc; font-size:100%; overflow:auto;}
+ code {font-size:100%; margin:0; padding:0;}
+ ul, ol {margin:10px 0 10px 25px;}
+ ol li {margin:0 0 10px;}
+
+
+
+
+
+ div#wrapper {background:#fff; width:560px; margin:0 auto; padding:20px; border:10px solid #bc8c46; border-width:0 10px;}
+ div#header {position:relative; border-bottom:1px dotted; margin:0 0 10px; padding:0 0 10px;}
+ div#header p {margin:0; padding:0;}
+ div#header h1 {margin:0; padding:0;}
+ ul#nav {position:absolute; top:0; right:0; list-style:none; margin:0; padding:0;}
+ ul#nav li {display:inline; padding:0 0 0 5px;}
+ ul#nav li a {}
+ div#content {}
+ div#footer {margin:40px 0 0; border-top:1px dotted; padding:10px 0 0;}
+
+
+
+
+
+
+}
View
77 website/index.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>HTTParty by John Nunemaker</title>
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
+</head>
+<body>
+
+<div id="wrapper">
+ <div id="header">
+ <h1>HTTParty</h1>
+ <p>Tonight we're gonna HTTParty like it's 1999!</p>
+
+ <ul id="nav">
+ <li><a href="rdoc/">Docs</a></li>
+ <li><a href="http://github.com/jnunemaker/httparty">Github</a></li>
+ <li><a href="http://rubyforge.org/projects/httparty/">Rubyforge</a></li>
+ </ul>
+ </div>
+
+ <div id="content">
+ <h2>Install</h2>
+ <pre><code>$ sudo gem install httparty</code></pre>
+
+ <h2>Some Quick Examples</h2>
+
+ <p>The following is a simple example of wrapping Twitter's API for posting updates.</p>
+
+<pre><code>class Twitter
+ include HTTParty
+ base_uri 'twitter.com'
+ basic_auth 'username', 'password'
+end
+
+Twitter.post('/statuses/update.json', :query => {:status => "It's an HTTParty and everyone is invited!"})</code></pre>
+
+ <p>That is really it! The object returned is a ruby hash that is decoded from Twitter's json response. JSON parsing is used because of the .json extension in the path of the request. You can also explicitly set a format (see the examples). </p>
+
+ <p>That works and all but what if you don't want to embed your username and password in the class? Below is an example to fix that:</p>
+
+<pre><code>class Twitter
+ include HTTParty
+ base_uri 'twitter.com'
+
+ def initialize(user, pass)
+ self.class.basic_auth user, pass
+ end
+
+ def post(text)
+ self.class.post('/statuses/update.json', :query => {:status => text})
+ end
+end
+
+Twitter.new('username', 'password').post("It's an HTTParty and everyone is invited!")</code></pre>
+
+ <p><strong>More Examples:</strong> There are <a href="http://github.com/jnunemaker/httparty/tree/master/examples/">several examples in the gem itself</a>.</p>
+
+ <h2>Support</h2>
+ <p>Conversations welcome in the <a href="http://groups.google.com/group/httparty-gem">google group</a> and bugs/features over at <a href="http://jnunemaker.lighthouseapp.com/projects/14842-httparty/overview">Lightouse</a>.</p>
+
+
+ </div>
+
+ <div id="footer">
+ <p>Created by <a href="http://addictedtonew.com/about/">John Nunemaker</a></p>
+ </div>
+</div>
+
+<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&amp;fid=5643"></script>
+<!-- 103bees.com 'bee' code -->
+</body>
+</html>

2 comments on commit b70ce56

@jualbuku

ikan lele

Please sign in to comment.
Something went wrong with that request. Please try again.