Top Level Namespace

Defined Under Namespace

Modules: Hybondnews

Instance Method Summary collapse

Instance Method Details

#hybondnewsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/hybondnews.rb', line 5

def hybondnews

    #ten_year_rate, fed reserve website 
    html = open("http://www.federalreserve.gov/releases/h15/current/").read
    doc = Nokogiri::HTML(open("http://www.federalreserve.gov/releases/h15/current/"))

    # HY Bonds new, leveraged finance website
    html =open("http://www.leveragedfinancenews.com/section/high_yield_bonds.html").read
    doc2 = Nokogiri::HTML(open("http://www.leveragedfinancenews.com/section/high_yield_bonds.html"))

    puts "Treasury Rate:"
    puts 
    puts "The latest 10-year treasury rate is #{doc.search("td")[271].text}%"
    puts 
    puts "HY Bond News:"
    puts 
    puts "#{doc2.search("h4")[0].text}"
    puts "#{doc2.search("div#contentWrap p")[0].text}"
    puts 
    puts "#{doc2.search("h4")[1].text}"
    puts "#{doc2.search("div#contentWrap p")[1].text}"
    puts 
    puts "#{doc2.search("h4")[2].text}"
    puts "#{doc2.search("div#contentWrap p")[2].text}"

end