Skip to content
This repository has been archived by the owner on Nov 16, 2018. It is now read-only.

Commit

Permalink
Wrapping up first release
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Mar 6, 2011
1 parent 3f8e388 commit b68f3bb
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 2 deletions.
4 changes: 4 additions & 0 deletions how_much.rb
Expand Up @@ -7,6 +7,10 @@ class HowMuch < Sinatra::Base
get '/' do
erb :index
end

get '/about' do
erb :about
end

get '/value.json' do
Zoopla.new(ENV['zoopla_api_key']).zed_index.in({:latitude => params[:lat], :longitude => params[:long]}).latest.to_json
Expand Down
Binary file added public/spinner.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions readme.markdown
@@ -0,0 +1,28 @@
HowMuch?!
=========

Tiny Geo-location aware house price checking web app

Install
-------

git clone git://github.com/andrew/how_much.git
cd how_much
bundle
shotgun -p 4567

Note on Patches/Pull Requests
-----------------------------

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

Copyright
---------

Copyright (c) 2011 Andrew Nesbitt. See LICENSE for details.
38 changes: 38 additions & 0 deletions views/about.erb
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<title>How much?!</title>
<link rel="apple-touch-icon" href="/house.png"/>
<style type="text/css" media="screen">
body{
font-family: Helvetica, Arial, sans-serif;
font-size:20px;
font-weight:bold;
}
#average{
color:#FF8000;
}

footer{
margin-top:10px;
font-weight:normal;
color:#aaa;
font-size:14px;
}
a{
color:#aaa;
}
</style>
<meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1.0;'>
</head>
<body>
<p>Find out how much houses cost on average where you are right now.</p>
<p>Powered by the <a href='http://zoopla.com'>Zoopla</a> API</p>
<p>Source available on <a href='http://github.com/andrew/how_much'>Github</a></p>
<footer>
Copyright &copy;
<a href='http://teabass.com'>Andrew Nesbitt</a> |
<a href='/'>Back</a>
</footer>
</body>
</html>
29 changes: 27 additions & 2 deletions views/index.erb
Expand Up @@ -32,13 +32,38 @@

function handle_geolocation_query(position){
$.getJSON('/value.json?lat='+position.coords.latitude+'&long='+position.coords.longitude, function(data, textStatus){
$('#average').text(' £'+data)
$('#average').text('£'+data)
});
}
</script>
<style type="text/css" media="screen">
body{
font-family: Helvetica, Arial, sans-serif;
font-size:40px;
font-weight:bold;
}
#average{
color:#FF8000;
}
footer{
margin-top:10px;
font-weight:normal;
color:#aaa;
font-size:14px;
}
footer a{
color:#aaa;
}
</style>
</style>
<meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1.0;'>
</head>
<body>
Average House Price around here:<span id="average"></span>
<p>Average House Price around here: <span id="average"><img src='/spinner.gif'></span></p>
<footer>
Copyright &copy;
<a href='http://teabass.com'>Andrew Nesbitt</a> |
<a href='/about'>About</a>
</footer>
</body>
</html>

0 comments on commit b68f3bb

Please sign in to comment.