Method: Ubiquitously::Tweako::Post#create

Defined in:
lib/ubiquitously/services/tweako.rb

#createObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ubiquitously/services/tweako.rb', line 32

def create
  page = agent.get("http://www.tweako.com/node/add/storylink")
  form = page.forms.detect { |form| form.form_node["id"] == "node-form" }
  
  form["edit[title]"] = token[:title]
  form["edit[vote_storylink_url]"] = token[:url]
  form.field_with(:name => "edit[taxonomy][1]").options.each do |option|
    option.select if option.value.to_s == "11"
  end
  form["edit[taxonomy][tags][2]"] = token[:tags]
  form["edit[body]"] = token[:description]
  form["op"] = "Submit"
  
  unless debug?
    page = form.submit
  end
  
  true
end