This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <Weather> | |
| <Current> | |
| <Location>Saint Louis, MO, US</Location> | |
| <RecordedAt>63109</RecordedAt> | |
| <Updated>5/11/2012 5:53:00 PM</Updated> | |
| <Image>32.png</Image> | |
| <Conditions>Clear</Conditions> | |
| <Temp>73</Temp> | |
| <Wind>5</Wind> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| desc "Fetch weather" | |
| task :fetch_weather => :environment do | |
| require 'nokogiri' | |
| require 'open-uri' | |
| @weathers = Weather.all | |
| @weathers.each do |weather| | |
| url = "http://kitchen.screenfeed.com/weather/both/dJlC_W1LY0-DukSjsfJV1w.xml?location=#{weather.zip}&formatter=newground" | |
| doc = Nokogiri::XML::Reader(open(url)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location /xml { | |
| proxy_pass http://xml.test.com; | |
| proxy_redirect off; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_max_temp_file_size 0; | |
| client_max_body_size 10m; | |
| client_body_buffer_size 128k; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You would go to ABC.com (my site); login w/ facebook/twitter or create an account | |
| upload a picture and description of the item, set your asking price; | |
| you would then like/tweet your storefront page | |
| people can visit the link, adn purchase the item right there w/ a CC | |
| then we take X%, and send you a paypal, or check | |
| only your friends would see the listing etc | |
| so risk of getting scammed, is nill | |
| and you avoid the craigslist spam etc | |
| what do you think? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @digital_product = DigitalProduct.new(params[:digital_product]) | |
| merchant.rb | |
| has_many :digital_products | |
| digital_products.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"FinancialData"=>{"Quote"=>{"company_name"=>"Alaska Air Group", "ticker"=>"ALK", "exchange"=>"NYSE", "last"=>"33.71", "previous"=>"34.13", "change"=>"-0.42", "change_percent"=>"-1.23%", "time_last"=>"5/30/2012 1:54:10 PM", "day_open"=>"33.91", "day_high"=>"34.15", "day_low"=>"33.45", "volume"=>"420125"}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| desc "Fetch stocks" | |
| task :fetch_stocks => :environment do | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'pp' | |
| @stocks = Stock.all | |
| @stocks.each do |stock| | |
| url = "ymbols=#{stock.ticker}" | |
| doc = Nokogiri::XML(open(url)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'omniauth/oauth' | |
| require 'multi_json' | |
| # | |
| module OmniAuth | |
| module Strategies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .rvm/gems/ruby-1.9.3-rc1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- omniauth/oauth (LoadError) | |
| require 'omniauth/oauth' | |
| require 'multi_json' | |
| # | |
| module OmniAuth | |
| module Strategies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'multi_json' | |
| module OmniAuth | |
| module Strategies | |
| class Stripedotcom < OAuth2 | |
| def initialize(app, client_id = nil, client_secret = nil, options = {}, &block ) | |
| client_options = { | |
| :site => " https://manage.stripe.com/oauth/authorize", | |
| :authorize_path => "/oauth/authorize", |