Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

figured out how to display only hyphenated tags

needs major refactor
  • Loading branch information...
commit a49a08196d7e25f598687649e51928444c7af5c8 1 parent 99a2a4c
@monfresh authored
View
3  app/controllers/users_controller.rb
@@ -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
View
21 app/views/users/show.html.erb
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.