Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base: db2501645a
...
compare: 64c7d77984
  • 12 commits
  • 8 files changed
  • 0 commit comments
  • 2 contributors
6 README.md
View
@@ -1,6 +1,10 @@
# GoogCurrency
-## Unfortunately the API stopped working on Nov. 1st 2013. This gem can no longer be used.
+## Google finance provides currency conversion functionality. Integrated the scrapper to get currency.
+Now uses http://www.google.com/finance/converter?a=1&from=USD&to=INR
+
+## Unfortunately the Google API stopped working on Nov. 1st 2013.
+
A simple Ruby interface for currency conversion using Google API. Uses http://www.google.com/ig/calculator?hl=en&q=100USD=?INR
6 goog_currency.gemspec
View
@@ -8,10 +8,8 @@ Gem::Specification.new do |gem|
gem.version = GoogCurrency::VERSION
gem.authors = ["Girish S"]
gem.email = ["girish.sonawane@gmail.com"]
- gem.description = %q{Ruby Gem for currency conversion using Google API}
- gem.summary = %q{Simple Ruby interface to Google Currency API}
- gem.add_runtime_dependency 'rest-client'
- gem.add_runtime_dependency 'json'
+ gem.description = %q{Ruby Gem for currency conversion using Google Finance }
+ gem.summary = %q{Simple Ruby interface to Google Finance Currency conversion}
gem.add_development_dependency "rspec", "~> 2.12.0"
gem.add_development_dependency "fakeweb", "~> 1.3.0"
30 lib/goog_currency.rb
View
@@ -1,9 +1,7 @@
require "goog_currency/version"
-require 'rest_client'
-require 'json'
+require 'open-uri'
module GoogCurrency
- MILLION = 1_000_000
def self.method_missing(meth, *args)
from, to = meth.to_s.split("_to_")
@@ -11,24 +9,8 @@ def self.method_missing(meth, *args)
raise NoMethodException, "GoogCurrency accepts methods in 'usd_to_inr' or 'gbp_to_usd' format"
end
- response = RestClient.get("http://www.google.com/ig/calculator?hl=en&q=#{args.first}#{from.upcase}=?#{to.upcase}").body
-
- response_hash = convert_response(response)
-
- if response_hash['error'].nil? or response_hash['error'] == ''
- case response_hash['rhs']
- when /million/
- response_hash['rhs'].to_f * MILLION
- when /billion/
- response_hash['rhs'].to_f * MILLION * 1_000
- when /trillion/
- response_hash['rhs'].to_f * MILLION * MILLION
- else
- response_hash['rhs'].to_f
- end
- else
- raise Exception, "An error occurred: #{response_hash['error']}"
- end
+ response = open("http://www.google.com/finance/converter?a=#{args.first}&from=#{from.upcase}&to=#{to.upcase}").read
+ handle_response(response)
end
def self.respond_to?(meth)
@@ -41,6 +23,12 @@ def self.respond_to?(meth)
end
end
+ def self.handle_response(response)
+ value = response.scan(/<span class=bld>([^.]+(?:\.(?:\d+))?)/)
+ raise Exception, "An error occurred: Currency not found" if value.empty?
+ value[0][0].to_f
+ end
+
def self.convert_response(response)
# response is not valid json
# Remove unicode character used as thousands separator by the Google API
2  lib/goog_currency/version.rb
View
@@ -1,3 +1,3 @@
module GoogCurrency
- VERSION = "1.0.2"
+ VERSION = "1.0.3"
end
56 spec/goog_currency_spec.rb
View
@@ -1,10 +1,11 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
+require File.expand_path(File.dirname(__FILE__) + '/response_helper')
require 'fakeweb'
require 'goog_currency'
valid_response =<<-VALID
-{lhs: "1 U.S. dollar",rhs: "54.836587 Indian rupees",error: "",icc: true}
+{lhs: "1 U.S. dollar",rhs: "62.2600 Indian rupees",error: "",icc: true}
VALID
valid100_response =<<-VALID_100
@@ -19,63 +20,56 @@
describe "valid currencies" do
it "converts USD to INR" do
FakeWeb.register_uri(:get,
- "http://www.google.com/ig/calculator?hl=en&q=1USD=?INR",
+ "http://www.google.com/finance/converter?a=1&from=USD&to=INR",
:status => "200",
- :body => valid_response)
+ :body => stub_usd_to_inr_response(1, 62.2600))
usd = GoogCurrency.usd_to_inr(1)
- usd.should == 54.836587
+ usd.should == 62.2600
end
it "ignores thousands separator correctly" do
FakeWeb.register_uri(:get,
- "http://www.google.com/ig/calculator?hl=en&q=100USD=?INR",
+ "http://www.google.com/finance/converter?a=100&from=USD&to=INR",
:status => "200",
- :body => valid100_response)
+ :body => stub_usd_to_inr_response(100, 6223))
usd = GoogCurrency.usd_to_inr(100)
- usd.should == 5483.6587
+ usd.should == 6223
end
- it "ignores new thousands separator correctly" do
- # performs live api call, not possible to reproduce the string
- # returned by the api
- expect { GoogCurrency.usd_to_inr(100) }.to_not raise_error
- end
-
- it "converts millions" do
+ it "should work with currency that input as float" do
FakeWeb.register_uri(:get,
- "http://www.google.com/ig/calculator?hl=en&q=500USD=?UGX",
+ "http://www.google.com/finance/converter?a=10.52&from=USD&to=INR",
:status => "200",
- :body => '{lhs: "500 U.S. dollars",rhs: "1.28534704 million Ugandan shillings",error: "",icc: true}')
- ugx = GoogCurrency.usd_to_ugx(500)
- ugx.should == 1_285_347.04
+ :body => stub_usd_to_inr_response(10.52, 654.6596))
+ usd = GoogCurrency.usd_to_inr(10.52)
+ usd.should == 654.6596
end
- it "converts billions" do
+ it "should work with currency that input as float and returns float" do
FakeWeb.register_uri(:get,
- "http://www.google.com/ig/calculator?hl=en&q=500000USD=?UGX",
+ "http://www.google.com/finance/converter?a=80.94&from=USD&to=INR",
:status => "200",
- :body => '{lhs: "500000 U.S. dollars",rhs: "1.28534704 billion Ugandan shillings",error: "",icc: true}')
- ugx = GoogCurrency.usd_to_ugx(500_000)
- ugx.should == 1_285_347_040.0
+ :body => stub_usd_to_inr_response(80.94, 5036.8962))
+ usd = GoogCurrency.usd_to_inr(80.94)
+ usd.should == 5036.8962
end
- it "converts trillions" do
+ it "should return same amount when same currency code for from and to" do
FakeWeb.register_uri(:get,
- "http://www.google.com/ig/calculator?hl=en&q=500000000USD=?UGX",
+ "http://www.google.com/finance/converter?a=1&from=USD&to=USD",
:status => "200",
- :body => '{lhs: "500000000 U.S. dollars",rhs: "1.28534704 trillion Ugandan shillings",error: "",icc: true}')
- ugx = GoogCurrency.usd_to_ugx(500_000_000)
- ugx.should == 1_285_347_040_000.0
+ :body => stub_usd_to_inr_response(1, 1))
+ usd = GoogCurrency.usd_to_usd(1)
+ usd.should == 1
end
-
end
describe "invalid currencies" do
it "throws exception for USD to INX" do
FakeWeb.register_uri(:get,
- "http://www.google.com/ig/calculator?hl=en&q=1USD=?INX",
+ "http://www.google.com/finance/converter?a==1USD=?INX",
:status => "200",
- :body => invalid_response)
+ :body => stub_error_response)
expect { GoogCurrency.usd_to_inx(1) }.to raise_error(GoogCurrency::Exception)
end
end
366 spec/helper/response_error.html
View
@@ -0,0 +1,366 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Currency Converter - Google Finance</title>
+<meta name="Description" content="Get real-time stock quotes & charts, financial news, currency conversions, or track your portfolio with Google Finance.">
+<link rel="stylesheet" type="text/css" href="/finance/s/Jtl56e5m90s/styles/finance_us.css">
+<link rel="icon"
+ type="image/vnd.microsoft.icon" href="/finance/favicon.ico"></head>
+<body style="margin-left: 6px; min-width: 0px;">
+<div class=g-doc>
+<form action="/finance/converter" method="get" name="f">
+<div class=sfe-break-top>
+<input name=a maxlength=12 size=5 autocomplete=off value="1">
+</div>
+<div class=sfe-break-top>
+<select name=from value="USD">
+<option value="AED">United Arab Emirates Dirham (AED)</option>
+<option value="AFN">Afghan Afghani (AFN)</option>
+<option value="ALL">Albanian Lek (ALL)</option>
+<option value="AMD">Armenian Dram (AMD)</option>
+<option value="ANG">Netherlands Antillean Guilder (ANG)</option>
+<option value="AOA">Angolan Kwanza (AOA)</option>
+<option value="ARS">Argentine Peso (ARS)</option>
+<option value="AUD">Australian Dollar (A$)</option>
+<option value="AWG">Aruban Florin (AWG)</option>
+<option value="AZN">Azerbaijani Manat (AZN)</option>
+<option value="BAM">Bosnia-Herzegovina Convertible Mark (BAM)</option>
+<option value="BBD">Barbadian Dollar (BBD)</option>
+<option value="BDT">Bangladeshi Taka (BDT)</option>
+<option value="BGN">Bulgarian Lev (BGN)</option>
+<option value="BHD">Bahraini Dinar (BHD)</option>
+<option value="BIF">Burundian Franc (BIF)</option>
+<option value="BMD">Bermudan Dollar (BMD)</option>
+<option value="BND">Brunei Dollar (BND)</option>
+<option value="BOB">Bolivian Boliviano (BOB)</option>
+<option value="BRL">Brazilian Real (R$)</option>
+<option value="BSD">Bahamian Dollar (BSD)</option>
+<option value="BTN">Bhutanese Ngultrum (BTN)</option>
+<option value="BWP">Botswanan Pula (BWP)</option>
+<option value="BYR">Belarusian Ruble (BYR)</option>
+<option value="BZD">Belize Dollar (BZD)</option>
+<option value="CAD">Canadian Dollar (CA$)</option>
+<option value="CDF">Congolese Franc (CDF)</option>
+<option value="CHF">Swiss Franc (CHF)</option>
+<option value="CLF">Chilean Unit of Account (UF) (CLF)</option>
+<option value="CLP">Chilean Peso (CLP)</option>
+<option value="CNH">CNH (CNH)</option>
+<option value="CNY">Chinese Yuan (CN¥)</option>
+<option value="COP">Colombian Peso (COP)</option>
+<option value="CRC">Costa Rican Colón (CRC)</option>
+<option value="CUP">Cuban Peso (CUP)</option>
+<option value="CVE">Cape Verdean Escudo (CVE)</option>
+<option value="CZK">Czech Republic Koruna (CZK)</option>
+<option value="DEM">German Mark (DEM)</option>
+<option value="DJF">Djiboutian Franc (DJF)</option>
+<option value="DKK">Danish Krone (DKK)</option>
+<option value="DOP">Dominican Peso (DOP)</option>
+<option value="DZD">Algerian Dinar (DZD)</option>
+<option value="EGP">Egyptian Pound (EGP)</option>
+<option value="ERN">Eritrean Nakfa (ERN)</option>
+<option value="ETB">Ethiopian Birr (ETB)</option>
+<option value="EUR">Euro (€)</option>
+<option value="FIM">Finnish Markka (FIM)</option>
+<option value="FJD">Fijian Dollar (FJD)</option>
+<option value="FKP">Falkland Islands Pound (FKP)</option>
+<option value="FRF">French Franc (FRF)</option>
+<option value="GBP">British Pound Sterling (£)</option>
+<option value="GEL">Georgian Lari (GEL)</option>
+<option value="GHS">Ghanaian Cedi (GHS)</option>
+<option value="GIP">Gibraltar Pound (GIP)</option>
+<option value="GMD">Gambian Dalasi (GMD)</option>
+<option value="GNF">Guinean Franc (GNF)</option>
+<option value="GTQ">Guatemalan Quetzal (GTQ)</option>
+<option value="GYD">Guyanaese Dollar (GYD)</option>
+<option value="HKD">Hong Kong Dollar (HK$)</option>
+<option value="HNL">Honduran Lempira (HNL)</option>
+<option value="HRK">Croatian Kuna (HRK)</option>
+<option value="HTG">Haitian Gourde (HTG)</option>
+<option value="HUF">Hungarian Forint (HUF)</option>
+<option value="IDR">Indonesian Rupiah (IDR)</option>
+<option value="IEP">Irish Pound (IEP)</option>
+<option value="ILS">Israeli New Sheqel (₪)</option>
+<option value="INR">Indian Rupee (Rs.)</option>
+<option value="IQD">Iraqi Dinar (IQD)</option>
+<option value="IRR">Iranian Rial (IRR)</option>
+<option value="ISK">Icelandic Króna (ISK)</option>
+<option value="ITL">Italian Lira (ITL)</option>
+<option value="JMD">Jamaican Dollar (JMD)</option>
+<option value="JOD">Jordanian Dinar (JOD)</option>
+<option value="JPY">Japanese Yen (¥)</option>
+<option value="KES">Kenyan Shilling (KES)</option>
+<option value="KGS">Kyrgystani Som (KGS)</option>
+<option value="KHR">Cambodian Riel (KHR)</option>
+<option value="KMF">Comorian Franc (KMF)</option>
+<option value="KPW">North Korean Won (KPW)</option>
+<option value="KRW">South Korean Won (₩)</option>
+<option value="KWD">Kuwaiti Dinar (KWD)</option>
+<option value="KYD">Cayman Islands Dollar (KYD)</option>
+<option value="KZT">Kazakhstani Tenge (KZT)</option>
+<option value="LAK">Laotian Kip (LAK)</option>
+<option value="LBP">Lebanese Pound (LBP)</option>
+<option value="LKR">Sri Lankan Rupee (LKR)</option>
+<option value="LRD">Liberian Dollar (LRD)</option>
+<option value="LSL">Lesotho Loti (LSL)</option>
+<option value="LTL">Lithuanian Litas (LTL)</option>
+<option value="LVL">Latvian Lats (LVL)</option>
+<option value="LYD">Libyan Dinar (LYD)</option>
+<option value="MAD">Moroccan Dirham (MAD)</option>
+<option value="MDL">Moldovan Leu (MDL)</option>
+<option value="MGA">Malagasy Ariary (MGA)</option>
+<option value="MKD">Macedonian Denar (MKD)</option>
+<option value="MMK">Myanmar Kyat (MMK)</option>
+<option value="MNT">Mongolian Tugrik (MNT)</option>
+<option value="MOP">Macanese Pataca (MOP)</option>
+<option value="MRO">Mauritanian Ouguiya (MRO)</option>
+<option value="MUR">Mauritian Rupee (MUR)</option>
+<option value="MVR">Maldivian Rufiyaa (MVR)</option>
+<option value="MWK">Malawian Kwacha (MWK)</option>
+<option value="MXN">Mexican Peso (MX$)</option>
+<option value="MYR">Malaysian Ringgit (MYR)</option>
+<option value="MZN">Mozambican Metical (MZN)</option>
+<option value="NAD">Namibian Dollar (NAD)</option>
+<option value="NGN">Nigerian Naira (NGN)</option>
+<option value="NIO">Nicaraguan Córdoba (NIO)</option>
+<option value="NOK">Norwegian Krone (NOK)</option>
+<option value="NPR">Nepalese Rupee (NPR)</option>
+<option value="NZD">New Zealand Dollar (NZ$)</option>
+<option value="OMR">Omani Rial (OMR)</option>
+<option value="PAB">Panamanian Balboa (PAB)</option>
+<option value="PEN">Peruvian Nuevo Sol (PEN)</option>
+<option value="PGK">Papua New Guinean Kina (PGK)</option>
+<option value="PHP">Philippine Peso (Php)</option>
+<option value="PKG">PKG (PKG)</option>
+<option value="PKR">Pakistani Rupee (PKR)</option>
+<option value="PLN">Polish Zloty (PLN)</option>
+<option value="PYG">Paraguayan Guarani (PYG)</option>
+<option value="QAR">Qatari Rial (QAR)</option>
+<option value="RON">Romanian Leu (RON)</option>
+<option value="RSD">Serbian Dinar (RSD)</option>
+<option value="RUB">Russian Ruble (RUB)</option>
+<option value="RWF">Rwandan Franc (RWF)</option>
+<option value="SAR">Saudi Riyal (SAR)</option>
+<option value="SBD">Solomon Islands Dollar (SBD)</option>
+<option value="SCR">Seychellois Rupee (SCR)</option>
+<option value="SDG">Sudanese Pound (SDG)</option>
+<option value="SEK">Swedish Krona (SEK)</option>
+<option value="SGD">Singapore Dollar (SGD)</option>
+<option value="SHP">Saint Helena Pound (SHP)</option>
+<option value="SLL">Sierra Leonean Leone (SLL)</option>
+<option value="SOS">Somali Shilling (SOS)</option>
+<option value="SRD">Surinamese Dollar (SRD)</option>
+<option value="STD">São Tomé and Príncipe Dobra (STD)</option>
+<option value="SVC">Salvadoran Colón (SVC)</option>
+<option value="SYP">Syrian Pound (SYP)</option>
+<option value="SZL">Swazi Lilangeni (SZL)</option>
+<option value="THB">Thai Baht (฿)</option>
+<option value="TJS">Tajikistani Somoni (TJS)</option>
+<option value="TMT">Turkmenistani Manat (TMT)</option>
+<option value="TND">Tunisian Dinar (TND)</option>
+<option value="TOP">Tongan Paʻanga (TOP)</option>
+<option value="TRY">Turkish Lira (TRY)</option>
+<option value="TTD">Trinidad and Tobago Dollar (TTD)</option>
+<option value="TWD">New Taiwan Dollar (NT$)</option>
+<option value="TZS">Tanzanian Shilling (TZS)</option>
+<option value="UAH">Ukrainian Hryvnia (UAH)</option>
+<option value="UGX">Ugandan Shilling (UGX)</option>
+<option SELECTED value="USD">US Dollar ($)</option>
+<option value="UYU">Uruguayan Peso (UYU)</option>
+<option value="UZS">Uzbekistan Som (UZS)</option>
+<option value="VEF">Venezuelan Bolívar (VEF)</option>
+<option value="VND">Vietnamese Dong (₫)</option>
+<option value="VUV">Vanuatu Vatu (VUV)</option>
+<option value="WST">Samoan Tala (WST)</option>
+<option value="XAF">CFA Franc BEAC (FCFA)</option>
+<option value="XCD">East Caribbean Dollar (EC$)</option>
+<option value="XDR">Special Drawing Rights (XDR)</option>
+<option value="XOF">CFA Franc BCEAO (CFA)</option>
+<option value="XPF">CFP Franc (CFPF)</option>
+<option value="YER">Yemeni Rial (YER)</option>
+<option value="ZAR">South African Rand (ZAR)</option>
+<option value="ZMK">Zambian Kwacha (1968–2012) (ZMK)</option>
+<option value="ZMW">Zambian Kwacha (ZMW)</option>
+<option value="ZWL">Zimbabwean Dollar (2009) (ZWL)</option>
+</select>
+</div>
+<div style="padding: 6px 8px">to</div>
+<div>
+<select name=to value="INX">
+<option value="AED">United Arab Emirates Dirham (AED)</option>
+<option value="AFN">Afghan Afghani (AFN)</option>
+<option value="ALL">Albanian Lek (ALL)</option>
+<option value="AMD">Armenian Dram (AMD)</option>
+<option value="ANG">Netherlands Antillean Guilder (ANG)</option>
+<option value="AOA">Angolan Kwanza (AOA)</option>
+<option value="ARS">Argentine Peso (ARS)</option>
+<option value="AUD">Australian Dollar (A$)</option>
+<option value="AWG">Aruban Florin (AWG)</option>
+<option value="AZN">Azerbaijani Manat (AZN)</option>
+<option value="BAM">Bosnia-Herzegovina Convertible Mark (BAM)</option>
+<option value="BBD">Barbadian Dollar (BBD)</option>
+<option value="BDT">Bangladeshi Taka (BDT)</option>
+<option value="BGN">Bulgarian Lev (BGN)</option>
+<option value="BHD">Bahraini Dinar (BHD)</option>
+<option value="BIF">Burundian Franc (BIF)</option>
+<option value="BMD">Bermudan Dollar (BMD)</option>
+<option value="BND">Brunei Dollar (BND)</option>
+<option value="BOB">Bolivian Boliviano (BOB)</option>
+<option value="BRL">Brazilian Real (R$)</option>
+<option value="BSD">Bahamian Dollar (BSD)</option>
+<option value="BTN">Bhutanese Ngultrum (BTN)</option>
+<option value="BWP">Botswanan Pula (BWP)</option>
+<option value="BYR">Belarusian Ruble (BYR)</option>
+<option value="BZD">Belize Dollar (BZD)</option>
+<option value="CAD">Canadian Dollar (CA$)</option>
+<option value="CDF">Congolese Franc (CDF)</option>
+<option value="CHF">Swiss Franc (CHF)</option>
+<option value="CLF">Chilean Unit of Account (UF) (CLF)</option>
+<option value="CLP">Chilean Peso (CLP)</option>
+<option value="CNH">CNH (CNH)</option>
+<option value="CNY">Chinese Yuan (CN¥)</option>
+<option value="COP">Colombian Peso (COP)</option>
+<option value="CRC">Costa Rican Colón (CRC)</option>
+<option value="CUP">Cuban Peso (CUP)</option>
+<option value="CVE">Cape Verdean Escudo (CVE)</option>
+<option value="CZK">Czech Republic Koruna (CZK)</option>
+<option value="DEM">German Mark (DEM)</option>
+<option value="DJF">Djiboutian Franc (DJF)</option>
+<option value="DKK">Danish Krone (DKK)</option>
+<option value="DOP">Dominican Peso (DOP)</option>
+<option value="DZD">Algerian Dinar (DZD)</option>
+<option value="EGP">Egyptian Pound (EGP)</option>
+<option value="ERN">Eritrean Nakfa (ERN)</option>
+<option value="ETB">Ethiopian Birr (ETB)</option>
+<option value="EUR">Euro (€)</option>
+<option value="FIM">Finnish Markka (FIM)</option>
+<option value="FJD">Fijian Dollar (FJD)</option>
+<option value="FKP">Falkland Islands Pound (FKP)</option>
+<option value="FRF">French Franc (FRF)</option>
+<option value="GBP">British Pound Sterling (£)</option>
+<option value="GEL">Georgian Lari (GEL)</option>
+<option value="GHS">Ghanaian Cedi (GHS)</option>
+<option value="GIP">Gibraltar Pound (GIP)</option>
+<option value="GMD">Gambian Dalasi (GMD)</option>
+<option value="GNF">Guinean Franc (GNF)</option>
+<option value="GTQ">Guatemalan Quetzal (GTQ)</option>
+<option value="GYD">Guyanaese Dollar (GYD)</option>
+<option value="HKD">Hong Kong Dollar (HK$)</option>
+<option value="HNL">Honduran Lempira (HNL)</option>
+<option value="HRK">Croatian Kuna (HRK)</option>
+<option value="HTG">Haitian Gourde (HTG)</option>
+<option value="HUF">Hungarian Forint (HUF)</option>
+<option value="IDR">Indonesian Rupiah (IDR)</option>
+<option value="IEP">Irish Pound (IEP)</option>
+<option value="ILS">Israeli New Sheqel (₪)</option>
+<option value="INR">Indian Rupee (Rs.)</option>
+<option value="IQD">Iraqi Dinar (IQD)</option>
+<option value="IRR">Iranian Rial (IRR)</option>
+<option value="ISK">Icelandic Króna (ISK)</option>
+<option value="ITL">Italian Lira (ITL)</option>
+<option value="JMD">Jamaican Dollar (JMD)</option>
+<option value="JOD">Jordanian Dinar (JOD)</option>
+<option value="JPY">Japanese Yen (¥)</option>
+<option value="KES">Kenyan Shilling (KES)</option>
+<option value="KGS">Kyrgystani Som (KGS)</option>
+<option value="KHR">Cambodian Riel (KHR)</option>
+<option value="KMF">Comorian Franc (KMF)</option>
+<option value="KPW">North Korean Won (KPW)</option>
+<option value="KRW">South Korean Won (₩)</option>
+<option value="KWD">Kuwaiti Dinar (KWD)</option>
+<option value="KYD">Cayman Islands Dollar (KYD)</option>
+<option value="KZT">Kazakhstani Tenge (KZT)</option>
+<option value="LAK">Laotian Kip (LAK)</option>
+<option value="LBP">Lebanese Pound (LBP)</option>
+<option value="LKR">Sri Lankan Rupee (LKR)</option>
+<option value="LRD">Liberian Dollar (LRD)</option>
+<option value="LSL">Lesotho Loti (LSL)</option>
+<option value="LTL">Lithuanian Litas (LTL)</option>
+<option value="LVL">Latvian Lats (LVL)</option>
+<option value="LYD">Libyan Dinar (LYD)</option>
+<option value="MAD">Moroccan Dirham (MAD)</option>
+<option value="MDL">Moldovan Leu (MDL)</option>
+<option value="MGA">Malagasy Ariary (MGA)</option>
+<option value="MKD">Macedonian Denar (MKD)</option>
+<option value="MMK">Myanmar Kyat (MMK)</option>
+<option value="MNT">Mongolian Tugrik (MNT)</option>
+<option value="MOP">Macanese Pataca (MOP)</option>
+<option value="MRO">Mauritanian Ouguiya (MRO)</option>
+<option value="MUR">Mauritian Rupee (MUR)</option>
+<option value="MVR">Maldivian Rufiyaa (MVR)</option>
+<option value="MWK">Malawian Kwacha (MWK)</option>
+<option value="MXN">Mexican Peso (MX$)</option>
+<option value="MYR">Malaysian Ringgit (MYR)</option>
+<option value="MZN">Mozambican Metical (MZN)</option>
+<option value="NAD">Namibian Dollar (NAD)</option>
+<option value="NGN">Nigerian Naira (NGN)</option>
+<option value="NIO">Nicaraguan Córdoba (NIO)</option>
+<option value="NOK">Norwegian Krone (NOK)</option>
+<option value="NPR">Nepalese Rupee (NPR)</option>
+<option value="NZD">New Zealand Dollar (NZ$)</option>
+<option value="OMR">Omani Rial (OMR)</option>
+<option value="PAB">Panamanian Balboa (PAB)</option>
+<option value="PEN">Peruvian Nuevo Sol (PEN)</option>
+<option value="PGK">Papua New Guinean Kina (PGK)</option>
+<option value="PHP">Philippine Peso (Php)</option>
+<option value="PKG">PKG (PKG)</option>
+<option value="PKR">Pakistani Rupee (PKR)</option>
+<option value="PLN">Polish Zloty (PLN)</option>
+<option value="PYG">Paraguayan Guarani (PYG)</option>
+<option value="QAR">Qatari Rial (QAR)</option>
+<option value="RON">Romanian Leu (RON)</option>
+<option value="RSD">Serbian Dinar (RSD)</option>
+<option value="RUB">Russian Ruble (RUB)</option>
+<option value="RWF">Rwandan Franc (RWF)</option>
+<option value="SAR">Saudi Riyal (SAR)</option>
+<option value="SBD">Solomon Islands Dollar (SBD)</option>
+<option value="SCR">Seychellois Rupee (SCR)</option>
+<option value="SDG">Sudanese Pound (SDG)</option>
+<option value="SEK">Swedish Krona (SEK)</option>
+<option value="SGD">Singapore Dollar (SGD)</option>
+<option value="SHP">Saint Helena Pound (SHP)</option>
+<option value="SLL">Sierra Leonean Leone (SLL)</option>
+<option value="SOS">Somali Shilling (SOS)</option>
+<option value="SRD">Surinamese Dollar (SRD)</option>
+<option value="STD">São Tomé and Príncipe Dobra (STD)</option>
+<option value="SVC">Salvadoran Colón (SVC)</option>
+<option value="SYP">Syrian Pound (SYP)</option>
+<option value="SZL">Swazi Lilangeni (SZL)</option>
+<option value="THB">Thai Baht (฿)</option>
+<option value="TJS">Tajikistani Somoni (TJS)</option>
+<option value="TMT">Turkmenistani Manat (TMT)</option>
+<option value="TND">Tunisian Dinar (TND)</option>
+<option value="TOP">Tongan Paʻanga (TOP)</option>
+<option value="TRY">Turkish Lira (TRY)</option>
+<option value="TTD">Trinidad and Tobago Dollar (TTD)</option>
+<option value="TWD">New Taiwan Dollar (NT$)</option>
+<option value="TZS">Tanzanian Shilling (TZS)</option>
+<option value="UAH">Ukrainian Hryvnia (UAH)</option>
+<option value="UGX">Ugandan Shilling (UGX)</option>
+<option value="USD">US Dollar ($)</option>
+<option value="UYU">Uruguayan Peso (UYU)</option>
+<option value="UZS">Uzbekistan Som (UZS)</option>
+<option value="VEF">Venezuelan Bolívar (VEF)</option>
+<option value="VND">Vietnamese Dong (₫)</option>
+<option value="VUV">Vanuatu Vatu (VUV)</option>
+<option value="WST">Samoan Tala (WST)</option>
+<option value="XAF">CFA Franc BEAC (FCFA)</option>
+<option value="XCD">East Caribbean Dollar (EC$)</option>
+<option value="XDR">Special Drawing Rights (XDR)</option>
+<option value="XOF">CFA Franc BCEAO (CFA)</option>
+<option value="XPF">CFP Franc (CFPF)</option>
+<option value="YER">Yemeni Rial (YER)</option>
+<option value="ZAR">South African Rand (ZAR)</option>
+<option value="ZMK">Zambian Kwacha (1968–2012) (ZMK)</option>
+<option value="ZMW">Zambian Kwacha (ZMW)</option>
+<option value="ZWL">Zimbabwean Dollar (2009) (ZWL)</option>
+</select>
+</div>
+&nbsp;
+<div id=currency_converter_result>
+<input type=submit value="Convert">
+</div>
+<input type=hidden name=meta value=ei&#61;5Yv8UoDzLYetkgWcDA>
+</form>
+</body>
+</div>
+</html>
366 spec/helper/response_usd_to_inr.html
View
@@ -0,0 +1,366 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Currency Converter - Google Finance</title>
+<meta name="Description" content="Get real-time stock quotes & charts, financial news, currency conversions, or track your portfolio with Google Finance.">
+<link rel="stylesheet" type="text/css" href="/finance/s/Jtl56e5m90s/styles/finance_us.css">
+<link rel="icon"
+ type="image/vnd.microsoft.icon" href="/finance/favicon.ico"></head>
+<body style="margin-left: 6px; min-width: 0px;">
+<div class=g-doc>
+<form action="/finance/converter" method="get" name="f">
+<div class=sfe-break-top>
+<input name=a maxlength=12 size=5 autocomplete=off value="2">
+</div>
+<div class=sfe-break-top>
+<select name=from value="BRL">
+<option value="AED">United Arab Emirates Dirham (AED)</option>
+<option value="AFN">Afghan Afghani (AFN)</option>
+<option value="ALL">Albanian Lek (ALL)</option>
+<option value="AMD">Armenian Dram (AMD)</option>
+<option value="ANG">Netherlands Antillean Guilder (ANG)</option>
+<option value="AOA">Angolan Kwanza (AOA)</option>
+<option value="ARS">Argentine Peso (ARS)</option>
+<option value="AUD">Australian Dollar (A$)</option>
+<option value="AWG">Aruban Florin (AWG)</option>
+<option value="AZN">Azerbaijani Manat (AZN)</option>
+<option value="BAM">Bosnia-Herzegovina Convertible Mark (BAM)</option>
+<option value="BBD">Barbadian Dollar (BBD)</option>
+<option value="BDT">Bangladeshi Taka (BDT)</option>
+<option value="BGN">Bulgarian Lev (BGN)</option>
+<option value="BHD">Bahraini Dinar (BHD)</option>
+<option value="BIF">Burundian Franc (BIF)</option>
+<option value="BMD">Bermudan Dollar (BMD)</option>
+<option value="BND">Brunei Dollar (BND)</option>
+<option value="BOB">Bolivian Boliviano (BOB)</option>
+<option value="BRL">Brazilian Real (R$)</option>
+<option value="BSD">Bahamian Dollar (BSD)</option>
+<option value="BTN">Bhutanese Ngultrum (BTN)</option>
+<option value="BWP">Botswanan Pula (BWP)</option>
+<option value="BYR">Belarusian Ruble (BYR)</option>
+<option value="BZD">Belize Dollar (BZD)</option>
+<option value="CAD">Canadian Dollar (CA$)</option>
+<option value="CDF">Congolese Franc (CDF)</option>
+<option value="CHF">Swiss Franc (CHF)</option>
+<option value="CLF">Chilean Unit of Account (UF) (CLF)</option>
+<option value="CLP">Chilean Peso (CLP)</option>
+<option value="CNH">CNH (CNH)</option>
+<option value="CNY">Chinese Yuan (CN¥)</option>
+<option value="COP">Colombian Peso (COP)</option>
+<option value="CRC">Costa Rican Colón (CRC)</option>
+<option value="CUP">Cuban Peso (CUP)</option>
+<option value="CVE">Cape Verdean Escudo (CVE)</option>
+<option value="CZK">Czech Republic Koruna (CZK)</option>
+<option value="DEM">German Mark (DEM)</option>
+<option value="DJF">Djiboutian Franc (DJF)</option>
+<option value="DKK">Danish Krone (DKK)</option>
+<option value="DOP">Dominican Peso (DOP)</option>
+<option value="DZD">Algerian Dinar (DZD)</option>
+<option value="EGP">Egyptian Pound (EGP)</option>
+<option value="ERN">Eritrean Nakfa (ERN)</option>
+<option value="ETB">Ethiopian Birr (ETB)</option>
+<option value="EUR">Euro (€)</option>
+<option value="FIM">Finnish Markka (FIM)</option>
+<option value="FJD">Fijian Dollar (FJD)</option>
+<option value="FKP">Falkland Islands Pound (FKP)</option>
+<option value="FRF">French Franc (FRF)</option>
+<option value="GBP">British Pound Sterling (£)</option>
+<option value="GEL">Georgian Lari (GEL)</option>
+<option value="GHS">Ghanaian Cedi (GHS)</option>
+<option value="GIP">Gibraltar Pound (GIP)</option>
+<option value="GMD">Gambian Dalasi (GMD)</option>
+<option value="GNF">Guinean Franc (GNF)</option>
+<option value="GTQ">Guatemalan Quetzal (GTQ)</option>
+<option value="GYD">Guyanaese Dollar (GYD)</option>
+<option value="HKD">Hong Kong Dollar (HK$)</option>
+<option value="HNL">Honduran Lempira (HNL)</option>
+<option value="HRK">Croatian Kuna (HRK)</option>
+<option value="HTG">Haitian Gourde (HTG)</option>
+<option value="HUF">Hungarian Forint (HUF)</option>
+<option value="IDR">Indonesian Rupiah (IDR)</option>
+<option value="IEP">Irish Pound (IEP)</option>
+<option value="ILS">Israeli New Sheqel (₪)</option>
+<option value="INR">Indian Rupee (Rs.)</option>
+<option value="IQD">Iraqi Dinar (IQD)</option>
+<option value="IRR">Iranian Rial (IRR)</option>
+<option value="ISK">Icelandic Króna (ISK)</option>
+<option value="ITL">Italian Lira (ITL)</option>
+<option value="JMD">Jamaican Dollar (JMD)</option>
+<option value="JOD">Jordanian Dinar (JOD)</option>
+<option value="JPY">Japanese Yen (¥)</option>
+<option value="KES">Kenyan Shilling (KES)</option>
+<option value="KGS">Kyrgystani Som (KGS)</option>
+<option value="KHR">Cambodian Riel (KHR)</option>
+<option value="KMF">Comorian Franc (KMF)</option>
+<option value="KPW">North Korean Won (KPW)</option>
+<option value="KRW">South Korean Won (₩)</option>
+<option value="KWD">Kuwaiti Dinar (KWD)</option>
+<option value="KYD">Cayman Islands Dollar (KYD)</option>
+<option value="KZT">Kazakhstani Tenge (KZT)</option>
+<option value="LAK">Laotian Kip (LAK)</option>
+<option value="LBP">Lebanese Pound (LBP)</option>
+<option value="LKR">Sri Lankan Rupee (LKR)</option>
+<option value="LRD">Liberian Dollar (LRD)</option>
+<option value="LSL">Lesotho Loti (LSL)</option>
+<option value="LTL">Lithuanian Litas (LTL)</option>
+<option value="LVL">Latvian Lats (LVL)</option>
+<option value="LYD">Libyan Dinar (LYD)</option>
+<option value="MAD">Moroccan Dirham (MAD)</option>
+<option value="MDL">Moldovan Leu (MDL)</option>
+<option value="MGA">Malagasy Ariary (MGA)</option>
+<option value="MKD">Macedonian Denar (MKD)</option>
+<option value="MMK">Myanmar Kyat (MMK)</option>
+<option value="MNT">Mongolian Tugrik (MNT)</option>
+<option value="MOP">Macanese Pataca (MOP)</option>
+<option value="MRO">Mauritanian Ouguiya (MRO)</option>
+<option value="MUR">Mauritian Rupee (MUR)</option>
+<option value="MVR">Maldivian Rufiyaa (MVR)</option>
+<option value="MWK">Malawian Kwacha (MWK)</option>
+<option value="MXN">Mexican Peso (MX$)</option>
+<option value="MYR">Malaysian Ringgit (MYR)</option>
+<option value="MZN">Mozambican Metical (MZN)</option>
+<option value="NAD">Namibian Dollar (NAD)</option>
+<option value="NGN">Nigerian Naira (NGN)</option>
+<option value="NIO">Nicaraguan Córdoba (NIO)</option>
+<option value="NOK">Norwegian Krone (NOK)</option>
+<option value="NPR">Nepalese Rupee (NPR)</option>
+<option value="NZD">New Zealand Dollar (NZ$)</option>
+<option value="OMR">Omani Rial (OMR)</option>
+<option value="PAB">Panamanian Balboa (PAB)</option>
+<option value="PEN">Peruvian Nuevo Sol (PEN)</option>
+<option value="PGK">Papua New Guinean Kina (PGK)</option>
+<option value="PHP">Philippine Peso (Php)</option>
+<option value="PKG">PKG (PKG)</option>
+<option value="PKR">Pakistani Rupee (PKR)</option>
+<option value="PLN">Polish Zloty (PLN)</option>
+<option value="PYG">Paraguayan Guarani (PYG)</option>
+<option value="QAR">Qatari Rial (QAR)</option>
+<option value="RON">Romanian Leu (RON)</option>
+<option value="RSD">Serbian Dinar (RSD)</option>
+<option value="RUB">Russian Ruble (RUB)</option>
+<option value="RWF">Rwandan Franc (RWF)</option>
+<option value="SAR">Saudi Riyal (SAR)</option>
+<option value="SBD">Solomon Islands Dollar (SBD)</option>
+<option value="SCR">Seychellois Rupee (SCR)</option>
+<option value="SDG">Sudanese Pound (SDG)</option>
+<option value="SEK">Swedish Krona (SEK)</option>
+<option value="SGD">Singapore Dollar (SGD)</option>
+<option value="SHP">Saint Helena Pound (SHP)</option>
+<option value="SLL">Sierra Leonean Leone (SLL)</option>
+<option value="SOS">Somali Shilling (SOS)</option>
+<option value="SRD">Surinamese Dollar (SRD)</option>
+<option value="STD">São Tomé and Príncipe Dobra (STD)</option>
+<option value="SVC">Salvadoran Colón (SVC)</option>
+<option value="SYP">Syrian Pound (SYP)</option>
+<option value="SZL">Swazi Lilangeni (SZL)</option>
+<option value="THB">Thai Baht (฿)</option>
+<option value="TJS">Tajikistani Somoni (TJS)</option>
+<option value="TMT">Turkmenistani Manat (TMT)</option>
+<option value="TND">Tunisian Dinar (TND)</option>
+<option value="TOP">Tongan Paʻanga (TOP)</option>
+<option value="TRY">Turkish Lira (TRY)</option>
+<option value="TTD">Trinidad and Tobago Dollar (TTD)</option>
+<option value="TWD">New Taiwan Dollar (NT$)</option>
+<option value="TZS">Tanzanian Shilling (TZS)</option>
+<option value="UAH">Ukrainian Hryvnia (UAH)</option>
+<option value="UGX">Ugandan Shilling (UGX)</option>
+<option SELECTED value="USD">US Dollar ($)</option>
+<option value="UYU">Uruguayan Peso (UYU)</option>
+<option value="UZS">Uzbekistan Som (UZS)</option>
+<option value="VEF">Venezuelan Bolívar (VEF)</option>
+<option value="VND">Vietnamese Dong (₫)</option>
+<option value="VUV">Vanuatu Vatu (VUV)</option>
+<option value="WST">Samoan Tala (WST)</option>
+<option value="XAF">CFA Franc BEAC (FCFA)</option>
+<option value="XCD">East Caribbean Dollar (EC$)</option>
+<option value="XDR">Special Drawing Rights (XDR)</option>
+<option value="XOF">CFA Franc BCEAO (CFA)</option>
+<option value="XPF">CFP Franc (CFPF)</option>
+<option value="YER">Yemeni Rial (YER)</option>
+<option value="ZAR">South African Rand (ZAR)</option>
+<option value="ZMK">Zambian Kwacha (1968–2012) (ZMK)</option>
+<option value="ZMW">Zambian Kwacha (ZMW)</option>
+<option value="ZWL">Zimbabwean Dollar (2009) (ZWL)</option>
+</select>
+</div>
+<div style="padding: 6px 8px">to</div>
+<div>
+<select name=to value="BGN">
+<option value="AED">United Arab Emirates Dirham (AED)</option>
+<option value="AFN">Afghan Afghani (AFN)</option>
+<option value="ALL">Albanian Lek (ALL)</option>
+<option value="AMD">Armenian Dram (AMD)</option>
+<option value="ANG">Netherlands Antillean Guilder (ANG)</option>
+<option value="AOA">Angolan Kwanza (AOA)</option>
+<option value="ARS">Argentine Peso (ARS)</option>
+<option value="AUD">Australian Dollar (A$)</option>
+<option value="AWG">Aruban Florin (AWG)</option>
+<option value="AZN">Azerbaijani Manat (AZN)</option>
+<option value="BAM">Bosnia-Herzegovina Convertible Mark (BAM)</option>
+<option value="BBD">Barbadian Dollar (BBD)</option>
+<option value="BDT">Bangladeshi Taka (BDT)</option>
+<option value="BGN">Bulgarian Lev (BGN)</option>
+<option value="BHD">Bahraini Dinar (BHD)</option>
+<option value="BIF">Burundian Franc (BIF)</option>
+<option value="BMD">Bermudan Dollar (BMD)</option>
+<option value="BND">Brunei Dollar (BND)</option>
+<option value="BOB">Bolivian Boliviano (BOB)</option>
+<option value="BRL">Brazilian Real (R$)</option>
+<option value="BSD">Bahamian Dollar (BSD)</option>
+<option value="BTN">Bhutanese Ngultrum (BTN)</option>
+<option value="BWP">Botswanan Pula (BWP)</option>
+<option value="BYR">Belarusian Ruble (BYR)</option>
+<option value="BZD">Belize Dollar (BZD)</option>
+<option value="CAD">Canadian Dollar (CA$)</option>
+<option value="CDF">Congolese Franc (CDF)</option>
+<option value="CHF">Swiss Franc (CHF)</option>
+<option value="CLF">Chilean Unit of Account (UF) (CLF)</option>
+<option value="CLP">Chilean Peso (CLP)</option>
+<option value="CNH">CNH (CNH)</option>
+<option value="CNY">Chinese Yuan (CN¥)</option>
+<option value="COP">Colombian Peso (COP)</option>
+<option value="CRC">Costa Rican Colón (CRC)</option>
+<option value="CUP">Cuban Peso (CUP)</option>
+<option value="CVE">Cape Verdean Escudo (CVE)</option>
+<option value="CZK">Czech Republic Koruna (CZK)</option>
+<option value="DEM">German Mark (DEM)</option>
+<option value="DJF">Djiboutian Franc (DJF)</option>
+<option value="DKK">Danish Krone (DKK)</option>
+<option value="DOP">Dominican Peso (DOP)</option>
+<option value="DZD">Algerian Dinar (DZD)</option>
+<option value="EGP">Egyptian Pound (EGP)</option>
+<option value="ERN">Eritrean Nakfa (ERN)</option>
+<option value="ETB">Ethiopian Birr (ETB)</option>
+<option value="EUR">Euro (€)</option>
+<option value="FIM">Finnish Markka (FIM)</option>
+<option value="FJD">Fijian Dollar (FJD)</option>
+<option value="FKP">Falkland Islands Pound (FKP)</option>
+<option value="FRF">French Franc (FRF)</option>
+<option value="GBP">British Pound Sterling (£)</option>
+<option value="GEL">Georgian Lari (GEL)</option>
+<option value="GHS">Ghanaian Cedi (GHS)</option>
+<option value="GIP">Gibraltar Pound (GIP)</option>
+<option value="GMD">Gambian Dalasi (GMD)</option>
+<option value="GNF">Guinean Franc (GNF)</option>
+<option value="GTQ">Guatemalan Quetzal (GTQ)</option>
+<option value="GYD">Guyanaese Dollar (GYD)</option>
+<option value="HKD">Hong Kong Dollar (HK$)</option>
+<option value="HNL">Honduran Lempira (HNL)</option>
+<option value="HRK">Croatian Kuna (HRK)</option>
+<option value="HTG">Haitian Gourde (HTG)</option>
+<option value="HUF">Hungarian Forint (HUF)</option>
+<option value="IDR">Indonesian Rupiah (IDR)</option>
+<option value="IEP">Irish Pound (IEP)</option>
+<option value="ILS">Israeli New Sheqel (₪)</option>
+<option SELECTED value="INR">Indian Rupee (Rs.)</option>
+<option value="IQD">Iraqi Dinar (IQD)</option>
+<option value="IRR">Iranian Rial (IRR)</option>
+<option value="ISK">Icelandic Króna (ISK)</option>
+<option value="ITL">Italian Lira (ITL)</option>
+<option value="JMD">Jamaican Dollar (JMD)</option>
+<option value="JOD">Jordanian Dinar (JOD)</option>
+<option value="JPY">Japanese Yen (¥)</option>
+<option value="KES">Kenyan Shilling (KES)</option>
+<option value="KGS">Kyrgystani Som (KGS)</option>
+<option value="KHR">Cambodian Riel (KHR)</option>
+<option value="KMF">Comorian Franc (KMF)</option>
+<option value="KPW">North Korean Won (KPW)</option>
+<option value="KRW">South Korean Won (₩)</option>
+<option value="KWD">Kuwaiti Dinar (KWD)</option>
+<option value="KYD">Cayman Islands Dollar (KYD)</option>
+<option value="KZT">Kazakhstani Tenge (KZT)</option>
+<option value="LAK">Laotian Kip (LAK)</option>
+<option value="LBP">Lebanese Pound (LBP)</option>
+<option value="LKR">Sri Lankan Rupee (LKR)</option>
+<option value="LRD">Liberian Dollar (LRD)</option>
+<option value="LSL">Lesotho Loti (LSL)</option>
+<option value="LTL">Lithuanian Litas (LTL)</option>
+<option value="LVL">Latvian Lats (LVL)</option>
+<option value="LYD">Libyan Dinar (LYD)</option>
+<option value="MAD">Moroccan Dirham (MAD)</option>
+<option value="MDL">Moldovan Leu (MDL)</option>
+<option value="MGA">Malagasy Ariary (MGA)</option>
+<option value="MKD">Macedonian Denar (MKD)</option>
+<option value="MMK">Myanmar Kyat (MMK)</option>
+<option value="MNT">Mongolian Tugrik (MNT)</option>
+<option value="MOP">Macanese Pataca (MOP)</option>
+<option value="MRO">Mauritanian Ouguiya (MRO)</option>
+<option value="MUR">Mauritian Rupee (MUR)</option>
+<option value="MVR">Maldivian Rufiyaa (MVR)</option>
+<option value="MWK">Malawian Kwacha (MWK)</option>
+<option value="MXN">Mexican Peso (MX$)</option>
+<option value="MYR">Malaysian Ringgit (MYR)</option>
+<option value="MZN">Mozambican Metical (MZN)</option>
+<option value="NAD">Namibian Dollar (NAD)</option>
+<option value="NGN">Nigerian Naira (NGN)</option>
+<option value="NIO">Nicaraguan Córdoba (NIO)</option>
+<option value="NOK">Norwegian Krone (NOK)</option>
+<option value="NPR">Nepalese Rupee (NPR)</option>
+<option value="NZD">New Zealand Dollar (NZ$)</option>
+<option value="OMR">Omani Rial (OMR)</option>
+<option value="PAB">Panamanian Balboa (PAB)</option>
+<option value="PEN">Peruvian Nuevo Sol (PEN)</option>
+<option value="PGK">Papua New Guinean Kina (PGK)</option>
+<option value="PHP">Philippine Peso (Php)</option>
+<option value="PKG">PKG (PKG)</option>
+<option value="PKR">Pakistani Rupee (PKR)</option>
+<option value="PLN">Polish Zloty (PLN)</option>
+<option value="PYG">Paraguayan Guarani (PYG)</option>
+<option value="QAR">Qatari Rial (QAR)</option>
+<option value="RON">Romanian Leu (RON)</option>
+<option value="RSD">Serbian Dinar (RSD)</option>
+<option value="RUB">Russian Ruble (RUB)</option>
+<option value="RWF">Rwandan Franc (RWF)</option>
+<option value="SAR">Saudi Riyal (SAR)</option>
+<option value="SBD">Solomon Islands Dollar (SBD)</option>
+<option value="SCR">Seychellois Rupee (SCR)</option>
+<option value="SDG">Sudanese Pound (SDG)</option>
+<option value="SEK">Swedish Krona (SEK)</option>
+<option value="SGD">Singapore Dollar (SGD)</option>
+<option value="SHP">Saint Helena Pound (SHP)</option>
+<option value="SLL">Sierra Leonean Leone (SLL)</option>
+<option value="SOS">Somali Shilling (SOS)</option>
+<option value="SRD">Surinamese Dollar (SRD)</option>
+<option value="STD">São Tomé and Príncipe Dobra (STD)</option>
+<option value="SVC">Salvadoran Colón (SVC)</option>
+<option value="SYP">Syrian Pound (SYP)</option>
+<option value="SZL">Swazi Lilangeni (SZL)</option>
+<option value="THB">Thai Baht (฿)</option>
+<option value="TJS">Tajikistani Somoni (TJS)</option>
+<option value="TMT">Turkmenistani Manat (TMT)</option>
+<option value="TND">Tunisian Dinar (TND)</option>
+<option value="TOP">Tongan Paʻanga (TOP)</option>
+<option value="TRY">Turkish Lira (TRY)</option>
+<option value="TTD">Trinidad and Tobago Dollar (TTD)</option>
+<option value="TWD">New Taiwan Dollar (NT$)</option>
+<option value="TZS">Tanzanian Shilling (TZS)</option>
+<option value="UAH">Ukrainian Hryvnia (UAH)</option>
+<option value="UGX">Ugandan Shilling (UGX)</option>
+<option value="USD">US Dollar ($)</option>
+<option value="UYU">Uruguayan Peso (UYU)</option>
+<option value="UZS">Uzbekistan Som (UZS)</option>
+<option value="VEF">Venezuelan Bolívar (VEF)</option>
+<option value="VND">Vietnamese Dong (₫)</option>
+<option value="VUV">Vanuatu Vatu (VUV)</option>
+<option value="WST">Samoan Tala (WST)</option>
+<option value="XAF">CFA Franc BEAC (FCFA)</option>
+<option value="XCD">East Caribbean Dollar (EC$)</option>
+<option value="XDR">Special Drawing Rights (XDR)</option>
+<option value="XOF">CFA Franc BCEAO (CFA)</option>
+<option value="XPF">CFP Franc (CFPF)</option>
+<option value="YER">Yemeni Rial (YER)</option>
+<option value="ZAR">South African Rand (ZAR)</option>
+<option value="ZMK">Zambian Kwacha (1968–2012) (ZMK)</option>
+<option value="ZMW">Zambian Kwacha (ZMW)</option>
+<option value="ZWL">Zimbabwean Dollar (2009) (ZWL)</option>
+</select>
+</div>
+&nbsp;
+<div id=currency_converter_result><placeholder_in> USD = <span class=bld><placeholder_out> INR</span>
+<input type=submit value="Convert">
+</div>
+<input type=hidden name=meta value=ei&#61;fWf7UuvxMMX0lAXKNw>
+</form>
+</body>
+</div>
+</html>
24 spec/response_helper.rb
View
@@ -0,0 +1,24 @@
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'rspec'
+
+require 'goog_currency'
+
+RSpec.configure do |config|
+
+end
+
+def stub_usd_to_inr_response(input, output)
+ File.open(File.expand_path(File.dirname(__FILE__) + '/helper/response_usd_to_inr.html'), 'r') do |f|
+ body = f.read
+ body.gsub!("<placeholder_in>", "#{input}")
+ body.gsub!("<placeholder_out>", "#{output}")
+ return body
+ end
+end
+
+def stub_error_response
+ File.open(File.expand_path(File.dirname(__FILE__) + '/helper/response_error.html'), 'r') do |f|
+ body = f.read
+ end
+end

No commit comments for this range

Something went wrong with that request. Please try again.