Malicious enjoyment derived from observing someone else’s misfortune
 

Tag Archives: curl

Thumper: a photo and YouTube aggregator for Rails

I made a project today. It’s called Thumper. All you have to do is post a special string to a url, and it does all the work. Catalog those cool images and videos. It’s available in https://modzer0.cs.uaf.edu/repos/hank/code/ruby/thumper It’s very simple to use. You run it anywhere, and make requests like this: # Makes a new YouTube video curl -i -X POST -d “video[code]=IsyWlcQAy-Q" http://server/youtube/new curl -i -X POST -d "photo[url]=http://www.ipnlighting.com/images/wasted.jpg" http://server/pics/new Voila! Thumper lives!

Stupid Open-URI problem

URI::InvalidURIError (bad URI(is not URI?): ‘http://www.ipnlighting.com/images/wasted.jpg’): /usr/local//lib/ruby/1.8/uri/common.rb:432:in `split’ /usr/local//lib/ruby/1.8/uri/common.rb:481:in `parse’ #… I couldn’t get it to work! Wait… Parameters: {“photo”=>{“url”=>”‘http://www.ipnlighting.com/images/wasted.jpg’”}, “action”=>”new”, “controller”=>”photos”} Of Course! curl -i -X POST -d \ “photo[url]=http://www.ipnlighting.com/images/wasted.jpg” \ http://localhost:3000/photos/new All better!