ruby - Using Curl to download files that require logging in -
i need download movie files website requires logging in. started prototyping script using mechanize, i'm wondering if curl supports sending username , password server, make work lot faster.
i use httparty rather curl. supports authentication.(http://httparty.rubyforge.org)
sudo gem install httparty
here example shows authentication taken site.
class twitter include httparty base_uri 'twitter.com' basic_auth 'username', 'password' end twitter.post('/statuses/update.json', :query => {:status => "it's httparty , invited!"})
Comments
Post a Comment