Created
September 25, 2012 23:37
-
-
Save halan/3785110 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra' | |
| require 'mechanize' | |
| require 'haml' | |
| get '/' do | |
| nickname = 'cogumm' | |
| board = 'nerd' | |
| url = "http://pinterest.com/#{nickname}/#{board}" | |
| pin_class = 'PinImageImg' | |
| @links = Mechanize.new.get(url).search("img.#{pin_class}").map {|i| i.attr('src') } | |
| haml :index | |
| end | |
| __END__ | |
| @@ layout | |
| !!! | |
| %html | |
| %body | |
| %h1 Nerd Board | |
| =yield | |
| @@ index | |
| -@links.each do |link| | |
| %img{:src => link} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment