Class: Hackershout::Provider::Hackernews

Inherits:
Base
  • Object
show all
Defined in:
lib/hackershout/provider/hackernews.rb

Constant Summary collapse

URL =
{
  :login => 'http://news.ycombinator.com/submit'
}

Instance Attribute Summary

Attributes inherited from Base

#agent

Instance Method Summary collapse

Methods inherited from Base

#initialize, #publish

Methods included from Output

#blank, #print

Constructor Details

This class inherits a constructor from Hackershout::Provider::Base

Instance Method Details

#postObject



9
10
11
12
13
14
15
16
# File 'lib/hackershout/provider/hackernews.rb', line 9

def post
  page = agent.get(URL[:login])
   = page.forms.first
  .u = @login
  .p = @password
  page = .submit
  submit(page) 
end