Skip to content

Commit

Permalink
onyl can search for venue
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffStahler committed Mar 5, 2012
1 parent 1ae01f7 commit 30cbf28
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def self.single_song_widget(top_song)
#4

class Spotify
ROOT_URL = 'http://ws.spotify.com/search/1/track.json?q='
ROOT_URL = 'http://ws.spotify.com/search/1/track.json?q=artist:'
def self.find_track(query)
query = URI.escape(query)
url = "#{ROOT_URL}#{query}"
Expand Down
13 changes: 1 addition & 12 deletions views/index.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
<form action="/search" method="post">
City: <input type="text" name="city"/>
Min Date: <input type="text" name="min_date"/>
Max Date: <input type="text" name="max_date"/>
<input type="submit" value="Submit" />
</form>


<form action="/venues" method="post">
Search for Venue: <input type="text" name="query"/>

</form>



<form action="/grooveshark" method="post">
Search for Song: <input type="text" name="query"/>

</form>
32 changes: 18 additions & 14 deletions views/venues.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<ul>
<% @calendar.events.each do |event| %>

<li><%= event.title %></li>

<ul>

<% event.artists.each do |artist| %>
<li> <%= artist %> </li>
<% end %>

</ul>
<% if @calendar.nil? %>
<h1> <%= "Venue not found" %>
<% else %>
<% end %>
</ul>
<%= @calendar.top_songs_spotify_uri %>
<% @calendar.events.each do |event| %>

<li><%= event.title %></li>

<ul>

<% event.artists.each do |artist| %>
<li> <%= artist %> </li>
<% end %>

</ul>

<% end %>
</ul>
<%= @calendar.top_songs_spotify_uri %>
<% end %>

0 comments on commit 30cbf28

Please sign in to comment.