Skip to content

Instantly share code, notes, and snippets.

require 'unirest'
puts "Please enter you city to find out the highs for the week"
city = gets.chomp.downcase
response = Unirest.get "https://george-vustrey-weather.p.mashape.com/api.php?location=#{city}",
headers:{'X-Mashape-Key'=> "17ECFHpjXjmshRDL0utKUrvKjcj6p1Yrg9TjsnJfGjy3okl7rq", 'Content-Type'=> "application/x-www-form-urlencoded"}
weather = response.body
weather.each {|x|
day_of_week = x["day_of_week"]
require 'httparty'
require 'nokogiri'
puts "Enter a stock ticker you would like to"
stock = gets.chomp.downcase
response = HTTParty.get("http://finance.yahoo.com/q?s=#{stock}")
dom = Nokogiri::HTML(response.body)
se = dom.xpath("//span[@id='yfs_l84_#{stock}']").first
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="name.js"></script>
<title>JS Bin</title>
</head>
<body>
<form>