Displaying articles with tag

Thumper: a photo and YouTube aggregator for Rails

Posted by hardwarehank, Sat Feb 17 17:55:35 UTC 2007

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!

Tags:

Stupid Open-URI problem

Posted by hardwarehank, Fri Feb 16 05:32:55 UTC 2007


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!

Tags: