Class: Ubiquitously::Propeller::Post
- Inherits:
-
Service::Post
- Object
- Base
- Service::Post
- Ubiquitously::Propeller::Post
- Defined in:
- lib/ubiquitously/services/propeller.rb
Instance Attribute Summary
Attributes inherited from Service::Post
#captcha, #categories, #description, #downvotes, #extension, #format, #image, #kind, #must_be_unique, #privacy, #rating, #remote, #service_id, #service_url, #slug, #source, #source_url, #state, #status, #tags, #title, #token, #upvotes, #url, #user, #vote
Instance Method Summary collapse
- #create ⇒ Object
-
#tokenize ⇒ Object
title max == 150.
Methods inherited from Service::Post
Methods included from Loggable::Post
Methods included from Restful::Post
Methods included from Ubiquitously::Postable::Post
Methods included from Ownable::Post
Methods inherited from Base
Methods included from SubclassableCallbacks
Constructor Details
This class inherits a constructor from Ubiquitously::Service::Post
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ubiquitously/services/propeller.rb', line 22 def create # url page = agent.get("http://www.propeller.com/story/submit/") form = page.forms.detect {|form| form.form_node["method"].downcase == "post"} form["url"] = token[:url] # details # http://www.propeller.com/story/submit/content/ page = form.submit form = page.forms.detect {|form| form.form_node["method"].downcase == "post"} form.(:name => "title_multi").each do || .check if .value == "-1" end form["title_multi_text"] = token[:title] form["description"] = token[:description] # separate by space, multi words are underscored form["user_tags"] = token[:tags] form.(:name => "category").each do || .check if .value.to_s == "18" end # http://www.propeller.com/story/submit/preview/ page = form.submit # approve page.forms[1].submit unless debug? page = form.submit end true end |
#tokenize ⇒ Object
title max == 150
18 19 20 |
# File 'lib/ubiquitously/services/propeller.rb', line 18 def tokenize super.merge(:tags => .taggify("_", " ")) end |