Permalink
Browse files

figured out how to display only hyphenated tags

needs major refactor
  • Loading branch information...
1 parent 99a2a4c commit a49a08196d7e25f598687649e51928444c7af5c8 @monfresh committed Apr 15, 2012
Showing with 18 additions and 6 deletions.
  1. +2 −1 app/controllers/users_controller.rb
  2. +16 −5 app/views/users/show.html.erb
@@ -30,7 +30,8 @@ def show
config.oauth_token_secret = @user.secret
end
client = Tumblr.new
- @blogs_following = client.following["blogs"]
+ @blogs = client.info["user"]["blogs"]
+ @first_blog_posts = client.posts("#{@blogs.first['name']}.tumblr.com")["posts"]
end
end
@@ -1,11 +1,22 @@
<h1>User: <%= @user.name %></h1>
+<br />
-<p>Email: <%= @user.email if @user.email %></p>
-<p>You are following these blogs:
+
+<h3>These are your Tumblr blogs:</h3>
+<ul>
+ <% @blogs.each do |blog| %>
+ <li><%= blog["name"] %></li>
+ <% end %>
+</ul>
+<br />
+<h3>These are your post tags from your first blog that contain hyphens:</h3>
<ul>
- <% @blogs_following.each do |f| %>
- <li><%= f["name"] %></li>
+ <% @first_blog_posts.each do |m| %>
+ <% m["tags"].each do |t| %>
+ <% if t.include? "-" %>
+ <li><%= t %></li>
+ <% end %>
+ <% end %>
<% end %>
</ul>
-</p>

0 comments on commit a49a081

Please sign in to comment.