<?xml version="1.0" encoding="UTF-8"?>
<article>
  <author>Ryan</author>
  <created-at type="datetime" nil="true"></created-at>
  <date type="date">2009-11-17</date>
  <id type="integer">41</id>
  <text>&lt;p&gt;At MITA, we use Google Apps for email, and online documents, spreadsheets, forms, chat, and more.  I've been weaving Applications together in an Intranet, using Ruby &amp; Rails.  Ruby is a pleasure to work with - it is logical, flexible, and powerful object-oriented scripting-type language.  The "Staff Listing" on the Intranet list the 50+ employees in the organization, and the data is pulled from PowerSchool, the school's Student Information System (SIS) [where all Employees are centrally managed anyway].  
                            &lt;/p&gt;
							
							&lt;p&gt;
							Using Ruby and Google's API, I've put together the following pages:
							
							
							&lt;ul&gt;
							&lt;li&gt;Index&lt;/li&gt;
							&lt;li&gt;Login&lt;br /&gt;
							Using a webform, submit Google login information (username and password) to https://www.google.com/accounts/ClientLogin , which returns the "token":
&lt;pre&gt;SID=DQAAAIUAAAAfSngN...
LSID=DQAAAIcAAAAinnV...
Auth=DQAAAIcAAAAinnV...&lt;/pre&gt;
							&lt;/li&gt;
							&lt;li&gt;Reports&lt;br /&gt;
							The "Reports" page uses the SID from the token, and submits a request to
							google.com/hosted/services/v1.0/reports/ReportingData.  Using Google's API, I can grab  *  accounts
    * activity
    * disk_space
    * email_clients
    * quota_limit_accounts
    * summary
    * suspended_accounts (described &lt;a href="http://code.google.com/apis/apps/reporting/google_apps_reporting_api.html"&gt;here&lt;/a&gt;).
							
							
							&lt;pre&gt;
@token = SID
@domain = your Google Apps domain name
      (this assumes you are using Google Apps for &lt;b&gt;your domain&lt;/b&gt;)							
@date = "2009-11-14"
							
# This XML String will be posted to the URL below							
xml_req =&lt;&lt;EOF
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;rest xmlns="google:accounts:rest:protocol"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "&gt;
&lt;type&gt;Report&lt;/type&gt;
&lt;token&gt;#{@token}&lt;/token&gt;
&lt;domain&gt;@domain&lt;/domain&gt;
&lt;date&gt;@date&lt;/date&gt;
&lt;reportType&gt;daily&lt;/reportType&gt;
&lt;reportName&gt;accounts&lt;/reportName&gt;
&lt;/rest&gt;
EOF


# This actually posts the Request
http = Net::HTTP.new('www.google.com', 443)
http.use_ssl = true
req = http.post('/hosted/services/v1.0/reports/ReportingData', xml_req)
							
							&lt;/pre&gt;
							
							
							&lt;/li&gt;
							
							
							&lt;/ul&gt;

&lt;p&gt;
I've also touched the surface pulling feeds from the domain, using google.com/a/feeds/domain_name - this is something
to explore a bit more.
&lt;/p&gt;</text>
  <title>Google Apps &amp; Ruby/Rails</title>
  <updated-at type="datetime">2009-11-18T20:00:28Z</updated-at>
</article>
