jspradlin-gmoney 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/Manifest +42 -0
  2. data/README.rdoc +29 -0
  3. data/Rakefile +25 -0
  4. data/gmoney.gemspec +30 -0
  5. data/lib/extensions/string.rb +10 -0
  6. data/lib/gmoney.rb +39 -0
  7. data/lib/gmoney/authentication_request.rb +52 -0
  8. data/lib/gmoney/feed_parser.rb +37 -0
  9. data/lib/gmoney/gf_request.rb +15 -0
  10. data/lib/gmoney/gf_response.rb +5 -0
  11. data/lib/gmoney/gf_service.rb +46 -0
  12. data/lib/gmoney/gf_session.rb +18 -0
  13. data/lib/gmoney/portfolio.rb +34 -0
  14. data/lib/gmoney/portfolio_feed_parser.rb +7 -0
  15. data/lib/gmoney/position.rb +33 -0
  16. data/lib/gmoney/position_feed_parser.rb +7 -0
  17. data/lib/gmoney/transaction.rb +21 -0
  18. data/lib/gmoney/transaction_feed_parser.rb +9 -0
  19. data/spec/authentication_request_spec.rb +101 -0
  20. data/spec/fixtures/cacert.pem +67 -0
  21. data/spec/fixtures/default_portfolios_feed.xml +45 -0
  22. data/spec/fixtures/empty_portfolio_feed.xml +24 -0
  23. data/spec/fixtures/portfolio_9_feed.xml +25 -0
  24. data/spec/fixtures/portfolio_feed_with_returns.xml +69 -0
  25. data/spec/fixtures/positions_feed_for_portfolio_14.xml +13 -0
  26. data/spec/fixtures/positions_feed_for_portfolio_9.xml +63 -0
  27. data/spec/fixtures/positions_feed_for_portfolio_9r.xml +130 -0
  28. data/spec/fixtures/transactions_feed_for_GOOG.xml +78 -0
  29. data/spec/gmoney_spec.rb +9 -0
  30. data/spec/portfolio_feed_parser_spec.rb +41 -0
  31. data/spec/portfolio_spec.rb +96 -0
  32. data/spec/position_feed_parser_spec.rb +39 -0
  33. data/spec/position_spec.rb +80 -0
  34. data/spec/request_spec.rb +29 -0
  35. data/spec/response_spec.rb +18 -0
  36. data/spec/service_spec.rb +127 -0
  37. data/spec/session_spec.rb +32 -0
  38. data/spec/spec.opts +2 -0
  39. data/spec/spec_helper.rb +1 -0
  40. data/spec/string_spec.rb +40 -0
  41. data/spec/transaction_feed_parser_spec.rb +29 -0
  42. data/spec/transaction_spec.rb +46 -0
  43. metadata +114 -0
@@ -0,0 +1,21 @@
1
+ module GMoney
2
+ class Transaction
3
+ class TransactionRequestError < StandardError; end
4
+
5
+ attr_reader :id, :updated, :title
6
+
7
+ attr_accessor :type, :date, :shares, :notes, :commission, :price
8
+
9
+ def self.find_by_url(url)
10
+ transactions = []
11
+
12
+ response = GFService.send_request(GFRequest.new(url, :headers => {"Authorization" => "GoogleLogin auth=#{GFSession.auth_token}"}))
13
+
14
+ if response.status_code == HTTPOK
15
+ TransactionFeedParser.parse_transaction_feed(response.body)
16
+ else
17
+ raise TransactionRequestError
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,9 @@
1
+ module GMoney
2
+ class TransactionFeedParser < FeedParser
3
+ def self.parse_transaction_feed(transaction_feed)
4
+ parse_feed(transaction_feed, Transaction, {:feed_link => false})
5
+ end
6
+ end
7
+ end
8
+
9
+
@@ -0,0 +1,101 @@
1
+ require File.join(File.dirname(__FILE__), '/spec_helper')
2
+
3
+ CA_CERT_FILE = File.join(File.dirname(__FILE__), '..', 'fixtures/cacert.pem')
4
+
5
+ describe GMoney::AuthenticationRequest do
6
+
7
+ before(:each) do
8
+ @request = GMoney::AuthenticationRequest.new('email', 'password')
9
+ @response = mock
10
+ end
11
+
12
+ it "should have a collection of parameters that include the email and password" do
13
+ expected =
14
+ {
15
+ 'Email' => 'user@example.com',
16
+ 'Passwd' => 'fuzzybunnies',
17
+ 'accountType' => 'HOSTED_OR_GOOGLE',
18
+ 'service' => 'finance',
19
+ 'source' => 'gmoney-001'
20
+ }
21
+
22
+ request = GMoney::AuthenticationRequest.new('user@example.com', 'fuzzybunnies')
23
+ request.parameters == expected
24
+ end
25
+
26
+ it "should have a URI" do
27
+ @request.uri.should be_eql(URI.parse('https://www.google.com/accounts/ClientLogin'))
28
+ end
29
+
30
+ it "should be able to send a request to the GAAPI service with proper ssl" do
31
+ @request.should_receive(:build_request).and_return('post')
32
+ @response.should_receive(:is_a?).with(Net::HTTPOK).and_return(true)
33
+
34
+ http = mock()
35
+ http.should_receive(:use_ssl=).with(true)
36
+ http.should_receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER)
37
+ http.should_receive(:ca_file=).with(CA_CERT_FILE)
38
+ http.should_receive(:request).with('post').and_yield(@response)
39
+
40
+ Net::HTTP.should_receive(:new).with('www.google.com', 443).and_return(http)
41
+ @request.send_request(OpenSSL::SSL::VERIFY_PEER)
42
+ end
43
+
44
+ it "should be able to send a request to the GAAPI service with ignoring ssl" do
45
+ @request.should_receive(:build_request).and_return('post')
46
+ @response.should_receive(:is_a?).with(Net::HTTPOK).and_return(true)
47
+
48
+ http = mock
49
+ http.should_receive(:use_ssl=).with(true)
50
+ http.should_receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_NONE)
51
+ http.should_receive(:request).with('post').and_yield(@response)
52
+
53
+ Net::HTTP.should_receive(:new).with('www.google.com', 443).and_return(http)
54
+ @request.send_request(OpenSSL::SSL::VERIFY_NONE)
55
+ end
56
+
57
+ it "should be able to build a request for the GAAPI service" do
58
+ params = "param"
59
+ @request.should_receive(:parameters).and_return(params)
60
+
61
+ post = mock
62
+ post.should_receive(:set_form_data).with(params)
63
+
64
+ Net::HTTP::Post.should_receive(:new).with('/accounts/ClientLogin').and_return(post)
65
+ @request.build_request
66
+ end
67
+
68
+ it "should be able to retrieve an auth_token from the body" do
69
+ response_data =
70
+ "SID=mysid\n" +
71
+ "LSID=mylsid\n" +
72
+ "Auth=auth_token\n"
73
+
74
+ @request.should_receive(:send_request).with(OpenSSL::SSL::VERIFY_NONE).and_return(stub(:body => response_data))
75
+ @request.auth_token.should be_eql('auth_token')
76
+ end
77
+
78
+ it "should use VERIFY_PEER if auth_token needs to be secure" do
79
+ response_data =
80
+ "SID=mysid\n" +
81
+ "LSID=mylsid\n" +
82
+ "Auth=auth_token\n"
83
+
84
+ @request.should_receive(:send_request).with(OpenSSL::SSL::VERIFY_PEER).and_return(stub(:body => response_data))
85
+ @request.auth_token(:secure => true).should be_eql('auth_token')
86
+ end
87
+
88
+ it "should raise an exception when requesting an auth_token when the authorization fails" do
89
+ @request.stub!(:build_request)
90
+ @response.should_receive(:is_a?).with(Net::HTTPOK).and_return(false)
91
+
92
+ http = stub
93
+ http.stub!(:use_ssl=)
94
+ http.stub!(:verify_mode=)
95
+ http.stub!(:request).and_yield(@response)
96
+
97
+ Net::HTTP.stub!(:new).with('www.google.com', 443).and_return(http)
98
+
99
+ lambda { @request.send_request(OpenSSL::SSL::VERIFY_NONE) }.should raise_error(GMoney::AuthenticationRequest::AuthError)
100
+ end
101
+ end
@@ -0,0 +1,67 @@
1
+ ##
2
+ ## cacert.pem-foo -- Bundle of CA Root Certificates
3
+ ##
4
+ ## Converted at: Thu Mar 26 21:23:06 2009 UTC
5
+ ##
6
+ ## This is a bundle of X.509 certificates of public Certificate Authorities
7
+ ## (CA). These were automatically extracted from Mozilla's root certificates
8
+ ## file (certdata.txt). This file can be found in the mozilla source tree:
9
+ ## '/mozilla/security/nss/lib/ckfw/builtins/certdata.txt'
10
+ ##
11
+ ## It contains the certificates in PEM format and therefore
12
+ ## can be directly used with curl / libcurl / php_curl, or with
13
+ ## an Apache+mod_ssl webserver for SSL client authentication.
14
+ ## Just configure this file as the SSLCACertificateFile.
15
+ ##
16
+
17
+ # ***** BEGIN LICENSE BLOCK *****
18
+ # Version: MPL 1.1/GPL 2.0/LGPL 2.1
19
+ #
20
+ # The contents of this file are subject to the Mozilla Public License Version
21
+ # 1.1 (the "License"); you may not use this file except in compliance with
22
+ # the License. You may obtain a copy of the License at
23
+ # http://www.mozilla.org/MPL/
24
+ #
25
+ # Software distributed under the License is distributed on an "AS IS" basis,
26
+ # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
27
+ # for the specific language governing rights and limitations under the
28
+ # License.
29
+ #
30
+ # The Original Code is the Netscape security libraries.
31
+ #
32
+ # The Initial Developer of the Original Code is
33
+ # Netscape Communications Corporation.
34
+ # Portions created by the Initial Developer are Copyright (C) 1994-2000
35
+ # the Initial Developer. All Rights Reserved.
36
+ #
37
+ # Contributor(s):
38
+ #
39
+ # Alternatively, the contents of this file may be used under the terms of
40
+ # either the GNU General Public License Version 2 or later (the "GPL"), or
41
+ # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
42
+ # in which case the provisions of the GPL or the LGPL are applicable instead
43
+ # of those above. If you wish to allow use of your version of this file only
44
+ # under the terms of either the GPL or the LGPL, and not to allow others to
45
+ # use your version of this file under the terms of the MPL, indicate your
46
+ # decision by deleting the provisions above and replace them with the notice
47
+ # and other provisions required by the GPL or the LGPL. If you do not delete
48
+ # the provisions above, a recipient may use your version of this file under
49
+ # the terms of any one of the MPL, the GPL or the LGPL.
50
+ #
51
+ # ***** END LICENSE BLOCK *****
52
+ # @(#) $RCSfile: certdata.txt,v $ $Revision: 1.51 $ $Date: 2009/01/15 22:35:15 $
53
+
54
+ Verisign/RSA Secure Server CA
55
+ =============================
56
+ -----BEGIN CERTIFICATE-----
57
+ MIICNDCCAaECEAKtZn5ORf5eV288mBle3cAwDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx
58
+ IDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2VydmVy
59
+ IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk0MTEwOTAwMDAwMFoXDTEwMDEwNzIzNTk1OVow
60
+ XzELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQL
61
+ EyVTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGbMA0GCSqGSIb3DQEBAQUA
62
+ A4GJADCBhQJ+AJLOesGugz5aqomDV6wlAXYMra6OLDfO6zV4ZFQD5YRAUcm/jwjiioII0haGN1Xp
63
+ sSECrXZogZoFokvJSyVmIlZsiAeP94FZbYQHZXATcXY+m3dM41CJVphIuR2nKRoTLkoRWZweFdVJ
64
+ VCxzOmmCsZc5nG1wZ0jl3S3WyB57AgMBAAEwDQYJKoZIhvcNAQECBQADfgBl3X7hsuyw4jrg7HFG
65
+ mhkRuNPHoLQDQCYCPgmc4RKz0Vr2N6W3YQO2WxZpO8ZECAyIUwxrl0nHPjXcbLm7qt9cuzovk2C2
66
+ qUtN8iD3zV9/ZHuO3ABc1/p3yjkWWW8O6tO1g39NTUJWdrTJXwT4OPjr0l91X817/OWOgHz8UA==
67
+ -----END CERTIFICATE-----
@@ -0,0 +1,45 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gf='http://schemas.google.com/finance/2007' xmlns:gd='http://schemas.google.com/g/2005'>
3
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios</id>
4
+ <updated>2009-07-11T21:21:11.000Z</updated>
5
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#portfolio' />
6
+ <title type='text'>Portfolio Feed</title>
7
+ <link rel='alternate' type='text/html' href='http://finance.google.com/finance/portfolio?action=view' />
8
+ <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios' />
9
+ <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios' />
10
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios' />
11
+ <openSearch:totalResults>2</openSearch:totalResults>
12
+ <openSearch:startIndex>1</openSearch:startIndex>
13
+ <openSearch:itemsPerPage>5</openSearch:itemsPerPage>
14
+ <entry>
15
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/8</id>
16
+ <updated>2009-06-13T18:31:11.000Z</updated>
17
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#portfolio' />
18
+ <title type='text'>Ruby Portfolio</title>
19
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/8' />
20
+ <link rel='edit' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/8' />
21
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/8/positions' />
22
+ <gf:portfolioData currencyCode='USD' gainPercentage='0.0' return1w='0.0' return1y='0.0' return3m='0.0' return3y='0.0' return4w='0.0' return5y='0.0' returnOverall='0.0' returnYTD='0.0' />
23
+ </entry>
24
+ <entry>
25
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9</id>
26
+ <updated>2009-07-11T21:21:11.000Z</updated>
27
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#portfolio' />
28
+ <title type='text'>GMoney Test</title>
29
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9' />
30
+ <link rel='edit' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9' />
31
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions' />
32
+ <gf:portfolioData currencyCode='USD' gainPercentage='0.0' return1w='0.0' return1y='0.0' return3m='0.0' return3y='0.0' return4w='0.0' return5y='0.0' returnOverall='0.0' returnYTD='0.0' />
33
+ </entry>
34
+ <entry>
35
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/3</id>
36
+ <updated>2009-09-03T02:13:33.000Z</updated>
37
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/finance/2007#portfolio" />
38
+ <title type="text">Jam 1</title>
39
+ <link rel="self" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios/14" />
40
+ <link rel="edit" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios/14" />
41
+ <gd:feedLink href="http://finance.google.com/finance/feeds/user@example.com/portfolios/14/positions" />
42
+ <gf:portfolioData currencyCode="USD" gainPercentage="0.0" return1w="0.0" return1y="0.0" return3m="0.0" return3y="0.0" return4w="0.0" return5y="0.0" returnOverall="0.0" returnYTD="0.0" />
43
+ </entry>
44
+ </feed>
45
+
@@ -0,0 +1,24 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gf='http://schemas.google.com/finance/2007' xmlns:gd='http://schemas.google.com/g/2005'>
3
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios</id>
4
+ <updated>2009-09-07T19:39:35.000Z</updated>
5
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#portfolio' />
6
+ <title type='text'>Portfolio Feed</title>
7
+ <link rel='alternate' type='text/html' href='http://finance.google.com/finance/portfolio?action=view' />
8
+ <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios' />
9
+ <link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios' />
10
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios?returns=true' />
11
+ <openSearch:totalResults>1</openSearch:totalResults>
12
+ <openSearch:startIndex>1</openSearch:startIndex>
13
+ <openSearch:itemsPerPage>1</openSearch:itemsPerPage>
14
+ <entry>
15
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/1</id>
16
+ <updated>2009-09-07T19:39:35.000Z</updated>
17
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#portfolio' />
18
+ <title type='text'>My Portfolio</title>
19
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/1' />
20
+ <link rel='edit' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/1' />
21
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/1/positions' />
22
+ <gf:portfolioData currencyCode='USD' gainPercentage='0.0' return1w='0.0' return1y='0.0' return3m='0.0' return3y='0.0' return4w='0.0' return5y='0.0' returnOverall='0.0' returnYTD='0.0' />
23
+ </entry>
24
+ </feed>
@@ -0,0 +1,25 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <entry xmlns='http://www.w3.org/2005/Atom' xmlns:gf='http://schemas.google.com/finance/2007' xmlns:gd='http://schemas.google.com/g/2005'>
3
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9</id>
4
+ <updated>2009-09-13T19:38:57.000Z</updated>
5
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#portfolio' />
6
+ <title type='text'>GMoney Test</title>
7
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9' />
8
+ <link rel='edit' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9' />
9
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions' />
10
+ <gf:portfolioData currencyCode='USD' gainPercentage='0.1667716917' return1w='0.05972647861' return1y='0.1546447982' return3m='0.1546447982' return3y='0.1546447982' return4w='0.1546447982' return5y='0.1546447982' returnOverall='0.1546447982'
11
+ returnYTD='0.1546447982'>
12
+ <gf:costBasis>
13
+ <gd:money amount='155915.25' currencyCode='USD' />
14
+ </gf:costBasis>
15
+ <gf:daysGain>
16
+ <gd:money amount='386.004875' currencyCode='USD' />
17
+ </gf:daysGain>
18
+ <gf:gain>
19
+ <gd:money amount='26002.25' currencyCode='USD' />
20
+ </gf:gain>
21
+ <gf:marketValue>
22
+ <gd:money amount='181917.5' currencyCode='USD' />
23
+ </gf:marketValue>
24
+ </gf:portfolioData>
25
+ </entry>
@@ -0,0 +1,69 @@
1
+ <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gf="http://schemas.google.com/finance/2007" xmlns:gd="http://schemas.google.com/g/2005">
2
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios</id>
3
+ <updated>2009-09-03T02:13:33.000Z</updated>
4
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/finance/2007#portfolio" />
5
+ <title type="text">Portfolio Feed</title>
6
+ <link rel="alternate" type="text/html" href="http://finance.google.com/finance/portfolio?action=view" />
7
+ <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios" />
8
+ <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios" />
9
+ <link rel="self" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios?returns=true" />
10
+ <openSearch:totalResults>8</openSearch:totalResults>
11
+ <openSearch:startIndex>1</openSearch:startIndex>
12
+ <openSearch:itemsPerPage>8</openSearch:itemsPerPage>
13
+ <entry>
14
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/8</id>
15
+ <updated>2009-09-03T02:13:33.000Z</updated>
16
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/finance/2007#portfolio" />
17
+ <title type="text">Ruby Portfolio</title>
18
+ <link rel="self" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios/8" />
19
+ <link rel="edit" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios/8" />
20
+ <gd:feedLink href="http://finance.google.com/finance/feeds/user@example.com/portfolios/8/positions" />
21
+ <gf:portfolioData currencyCode="USD" gainPercentage="28.3636" return1w="-0.07621550591" return1y="0.0" return3m="0.0" return3y="0.0" return4w="-0.1670616114" return5y="0.0" returnOverall="0.0" returnYTD="0.0">
22
+ <gf:costBasis>
23
+ <gd:money amount="2500.0" currencyCode="USD" />
24
+ </gf:costBasis>
25
+ <gf:daysGain>
26
+ <gd:money amount="-2111.0001" currencyCode="USD" />
27
+ </gf:daysGain>
28
+ <gf:gain>
29
+ <gd:money amount="70909.0" currencyCode="USD" />
30
+ </gf:gain>
31
+ <gf:marketValue>
32
+ <gd:money amount="73409.0" currencyCode="USD" />
33
+ </gf:marketValue>
34
+ </gf:portfolioData>
35
+ </entry>
36
+ <entry>
37
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9</id>
38
+ <updated>2009-09-03T02:13:33.000Z</updated>
39
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/finance/2007#portfolio" />
40
+ <title type="text">GMoney Test</title>
41
+ <link rel="self" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios/9" />
42
+ <link rel="edit" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios/9" />
43
+ <gd:feedLink href="http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions" />
44
+ <gf:portfolioData currencyCode="USD" gainPercentage="0.2187420382" return1w="0.0" return1y="0.0" return3m="0.0" return3y="0.0" return4w="0.0" return5y="0.0" returnOverall="0.0" returnYTD="0.0">
45
+ <gf:costBasis>
46
+ <gd:money amount="62800.0" currencyCode="USD" />
47
+ </gf:costBasis>
48
+ <gf:daysGain>
49
+ <gd:money amount="-351.8994" currencyCode="USD" />
50
+ </gf:daysGain>
51
+ <gf:gain>
52
+ <gd:money amount="13737.0" currencyCode="USD" />
53
+ </gf:gain>
54
+ <gf:marketValue>
55
+ <gd:money amount="76537.0" currencyCode="USD" />
56
+ </gf:marketValue>
57
+ </gf:portfolioData>
58
+ </entry>
59
+ <entry>
60
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/14</id>
61
+ <updated>2009-09-03T02:13:33.000Z</updated>
62
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/finance/2007#portfolio" />
63
+ <title type="text">Jam 1</title>
64
+ <link rel="self" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios/14" />
65
+ <link rel="edit" type="application/atom+xml" href="http://finance.google.com/finance/feeds/default/portfolios/14" />
66
+ <gd:feedLink href="http://finance.google.com/finance/feeds/user@example.com/portfolios/14/positions" />
67
+ <gf:portfolioData currencyCode="USD" gainPercentage="0.0" return1w="0.0" return1y="0.0" return3m="0.0" return3y="0.0" return4w="0.0" return5y="0.0" returnOverall="0.0" returnYTD="0.0" />
68
+ </entry>
69
+ </feed>
@@ -0,0 +1,13 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gf='http://schemas.google.com/finance/2007' xmlns:gd='http://schemas.google.com/g/2005'>
3
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/14/positions</id>
4
+ <updated>2007-01-01T00:00:00.000Z</updated>
5
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#position' />
6
+ <title type='text'>Jam 1</title>
7
+ <link rel='alternate' type='text/html' href='http://finance.google.com/finance/portfolio?action=view&amp;pid=14' />
8
+ <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/14/positions' />
9
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/14/positions' />
10
+ <openSearch:totalResults>0</openSearch:totalResults>
11
+ <openSearch:startIndex>1</openSearch:startIndex>
12
+ <openSearch:itemsPerPage>0</openSearch:itemsPerPage>
13
+ </feed>
@@ -0,0 +1,63 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gf='http://schemas.google.com/finance/2007' xmlns:gd='http://schemas.google.com/g/2005'>
3
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions</id>
4
+ <updated>2009-09-12T16:18:32.000Z</updated>
5
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#position' />
6
+ <title type='text'>GMoney Test</title>
7
+ <link rel='alternate' type='text/html' href='http://finance.google.com/finance/portfolio?action=view&amp;pid=9' />
8
+ <link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9/positions' />
9
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9/positions' />
10
+ <openSearch:totalResults>5</openSearch:totalResults>
11
+ <openSearch:startIndex>1</openSearch:startIndex>
12
+ <openSearch:itemsPerPage>5</openSearch:itemsPerPage>
13
+ <entry>
14
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NASDAQ:JAVA</id>
15
+ <updated>2009-09-12T16:18:32.000Z</updated>
16
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#position' />
17
+ <title type='text'>Sun Microsystems, Inc.</title>
18
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9/positions/NASDAQ%3AJAVA' />
19
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NASDAQ:JAVA/transactions' />
20
+ <gf:positionData gainPercentage='0.0' return1w='0.0' return1y='0.0' return3m='0.0' return3y='0.0' return4w='0.0' return5y='0.0' returnOverall='0.0' returnYTD='0.0' shares='75.0' />
21
+ <gf:symbol exchange='NASDAQ' fullName='Sun Microsystems, Inc.' symbol='JAVA' />
22
+ </entry>
23
+ <entry>
24
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NASDAQ:GOOG</id>
25
+ <updated>2009-09-12T16:18:32.000Z</updated>
26
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#position' />
27
+ <title type='text'>Google Inc.</title>
28
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9/positions/NASDAQ%3AGOOG' />
29
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NASDAQ:GOOG/transactions' />
30
+ <gf:positionData gainPercentage='0.0' return1w='0.0' return1y='0.0' return3m='0.0' return3y='0.0' return4w='0.0' return5y='0.0' returnOverall='0.0' returnYTD='0.0' shares='75.0' />
31
+ <gf:symbol exchange='NASDAQ' fullName='Google Inc.' symbol='GOOG' />
32
+ </entry>
33
+ <entry>
34
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NASDAQ:AAPL</id>
35
+ <updated>2009-09-12T16:18:32.000Z</updated>
36
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#position' />
37
+ <title type='text'>Apple Inc.</title>
38
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9/positions/NASDAQ%3AAAPL' />
39
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NASDAQ:AAPL/transactions' />
40
+ <gf:positionData gainPercentage='0.0' return1w='0.0' return1y='0.0' return3m='0.0' return3y='0.0' return4w='0.0' return5y='0.0' returnOverall='0.0' returnYTD='0.0' shares='100.0' />
41
+ <gf:symbol exchange='NASDAQ' fullName='Apple Inc.' symbol='AAPL' />
42
+ </entry>
43
+ <entry>
44
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NASDAQ:ORCL</id>
45
+ <updated>2009-09-12T16:18:32.000Z</updated>
46
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#position' />
47
+ <title type='text'>Oracle Corporation</title>
48
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9/positions/NASDAQ%3AORCL' />
49
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NASDAQ:ORCL/transactions' />
50
+ <gf:positionData gainPercentage='0.0' return1w='0.0' return1y='0.0' return3m='0.0' return3y='0.0' return4w='0.0' return5y='0.0' returnOverall='0.0' returnYTD='0.0' shares='75.0' />
51
+ <gf:symbol exchange='NASDAQ' fullName='Oracle Corporation' symbol='ORCL' />
52
+ </entry>
53
+ <entry>
54
+ <id>http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NYSE:IBM</id>
55
+ <updated>2009-09-12T16:18:32.000Z</updated>
56
+ <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/finance/2007#position' />
57
+ <title type='text'>International Business Machines Corp.</title>
58
+ <link rel='self' type='application/atom+xml' href='http://finance.google.com/finance/feeds/default/portfolios/9/positions/NYSE%3AIBM' />
59
+ <gd:feedLink href='http://finance.google.com/finance/feeds/user@example.com/portfolios/9/positions/NYSE:IBM/transactions' />
60
+ <gf:positionData gainPercentage='0.0' return1w='0.0' return1y='0.0' return3m='0.0' return3y='0.0' return4w='0.0' return5y='0.0' returnOverall='0.0' returnYTD='0.0' shares='75.0' />
61
+ <gf:symbol exchange='NYSE' fullName='International Business Machines Corp.' symbol='IBM' />
62
+ </entry>
63
+ </feed>