Class: HeadstartFinder

Inherits:
BaseFinder show all
Defined in:
lib/headstart_finder.rb

Instance Method Summary collapse

Methods inherited from BaseFinder

#precentage, #reload, #set, #to_json

Methods included from AbstractInterface

included

Instance Method Details

#days_to_goObject



17
18
19
20
21
# File 'lib/headstart_finder.rb', line 17

def days_to_go
  @body.css('.projectstatus').css('.bb').css('.l').css('div')[0].text.gsub("\n", ' ').gsub("\r", ' ').squeeze(' ').scan(/\d+/).join(",")
  rescue => e
    ""
end

#deadlineObject



23
24
25
# File 'lib/headstart_finder.rb', line 23

def deadline
    "N/A"
end

#goalObject



43
44
45
46
47
# File 'lib/headstart_finder.rb', line 43

def goal
  @body.css('.projectstatus').css('.pl').text.gsub('\n', '').gsub("\n", ' ').gsub("\r", ' ').squeeze(' ').scan(/\d+/).join(",")
  rescue => e
    ""
end

#num_of_backersObject



27
28
29
30
31
# File 'lib/headstart_finder.rb', line 27

def num_of_backers
  @body.css('.projectstatus').css('.bb').css('.r').css('.t1').text.gsub("\n", ' ').gsub("\r", ' ').squeeze(' ')
  rescue => e
    ""
end

#picture_urlObject



49
50
51
52
53
# File 'lib/headstart_finder.rb', line 49

def picture_url
  "https://www.headstart.co.il/#{@body.css('.pic').css('img')[0]['src'].split('&')[0]}"
  rescue => e
    ""
end

#pledgedObject



37
38
39
40
41
# File 'lib/headstart_finder.rb', line 37

def pledged
  @body.css('.projectstatus').css('.cu').text.gsub('\n', '').gsub("\n", ' ').gsub("\r", ' ').squeeze(' ').scan(/\d+/).join(",")
  rescue => e
    ""
end

#project_nameObject



11
12
13
14
15
# File 'lib/headstart_finder.rb', line 11

def project_name
  @body.css('.leftpanel')[0].css('h1').text.gsub("\n", ' ').squeeze(' ')
  rescue => e
    ""
end

#test_printObject



5
6
7
8
9
# File 'lib/headstart_finder.rb', line 5

def test_print
  "I'm #{self.class.name} and my url is #{@url}"
  rescue => e
    ""
end


33
34
35
# File 'lib/headstart_finder.rb', line 33

def twitter_link
    ""
end