hybondnews 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +29 -0
- data/LICENSE.txt +22 -0
- data/README.md +35 -0
- data/Rakefile +2 -0
- data/hybondnews.gemspec +25 -0
- data/lib/hybondnews/version.rb +3 -0
- data/lib/hybondnews.rb +36 -0
- data/pkg/hybondnews-0.0.1.gem +0 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 46980ede6285c5ab2c24a413b7977bb78dcd3eb2
|
4
|
+
data.tar.gz: 74d45373df4c1a8286932006ea26fdeb8da634a4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 073bd2d1ce71a11382643c470822bf9fd6301e48a955a0293fd2ab5bb3cdc29cc0e823305bad9eefd6d209821fb8ab34dc9431f18d96c959cfeca8dfcc28c63a
|
7
|
+
data.tar.gz: cf3c5fdc05345a866356a8912efd4a4e868f590067226ffa9bc5d3e47f9206ffbd4bc30ec3b5f1ce7264e39d67f981143ce329f8ed80986776945907404264c7
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
hybondnews (0.0.1)
|
5
|
+
nokogiri
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
coderay (1.1.0)
|
11
|
+
method_source (0.8.2)
|
12
|
+
mini_portile (0.6.0)
|
13
|
+
nokogiri (1.6.2.1)
|
14
|
+
mini_portile (= 0.6.0)
|
15
|
+
pry (0.10.0)
|
16
|
+
coderay (~> 1.1.0)
|
17
|
+
method_source (~> 0.8.1)
|
18
|
+
slop (~> 3.4)
|
19
|
+
rake (10.3.2)
|
20
|
+
slop (3.5.0)
|
21
|
+
|
22
|
+
PLATFORMS
|
23
|
+
ruby
|
24
|
+
|
25
|
+
DEPENDENCIES
|
26
|
+
bundler (~> 1.6)
|
27
|
+
hybondnews!
|
28
|
+
pry
|
29
|
+
rake
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Ben Shore & Amber Tunnell
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Hybondnews
|
2
|
+
|
3
|
+
A web-scraping gem that provides live news updates related to the High Yield Bond Markets.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'hybondnews'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install hybondnews
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
For the current 10-year treasury rate from the Federal Reserve:
|
22
|
+
|
23
|
+
HYBondNews.t_rate
|
24
|
+
|
25
|
+
For the latest 3 articles from www.leveragedfinancenews.com:
|
26
|
+
|
27
|
+
HYBondNews.bond_news
|
28
|
+
|
29
|
+
## Contributing
|
30
|
+
|
31
|
+
1. Fork it ( https://github.com/[my-github-username]/hybondnews/fork )
|
32
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
35
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/hybondnews.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'hybondnews/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "hybondnews"
|
8
|
+
spec.version = Hybondnews::VERSION
|
9
|
+
spec.authors = ["Ben Shore","Amber Tunnell"]
|
10
|
+
spec.email = ["amber.tunnell@gmail.com"]
|
11
|
+
spec.summary = %q{Web-scraping gem for High Yield Bond News}
|
12
|
+
spec.description = %q{A nokogiri-based web-scraping gem that provides live news updates related to the High Yield Bond Markets.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "pry"
|
24
|
+
spec.add_runtime_dependency "nokogiri"
|
25
|
+
end
|
data/lib/hybondnews.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require "hybondnews/version"
|
2
|
+
require "open-uri"
|
3
|
+
require "nokogiri"
|
4
|
+
|
5
|
+
module HYBondNews
|
6
|
+
def self.t_rate
|
7
|
+
#ten_year_rate, fed reserve website
|
8
|
+
html = open("http://www.federalreserve.gov/releases/h15/current/").read
|
9
|
+
doc = Nokogiri::HTML(open("http://www.federalreserve.gov/releases/h15/current/"))
|
10
|
+
|
11
|
+
<<-TEXT
|
12
|
+
The latest 10-year treasury rate is #{doc.search("td")[271].text}%
|
13
|
+
TEXT
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.bond_news
|
18
|
+
# HY Bonds new, leveraged finance website
|
19
|
+
html =open("http://www.leveragedfinancenews.com/section/high_yield_bonds.html").read
|
20
|
+
doc2 = Nokogiri::HTML(open("http://www.leveragedfinancenews.com/section/high_yield_bonds.html"))
|
21
|
+
|
22
|
+
<<-TEXT
|
23
|
+
HY Bond News
|
24
|
+
|
25
|
+
#{doc2.search("h4")[0].text}
|
26
|
+
#{doc2.search("div#contentWrap p")[0].text}
|
27
|
+
|
28
|
+
#{doc2.search("h4")[1].text}
|
29
|
+
#{doc2.search("div#contentWrap p")[1].text}
|
30
|
+
|
31
|
+
#{doc2.search("h4")[2].text}
|
32
|
+
#{doc2.search("div#contentWrap p")[2].text}
|
33
|
+
|
34
|
+
TEXT
|
35
|
+
end
|
36
|
+
end
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hybondnews
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben Shore
|
8
|
+
- Amber Tunnell
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-06-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.6'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.6'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: pry
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: nokogiri
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
description: A nokogiri-based web-scraping gem that provides live news updates related
|
71
|
+
to the High Yield Bond Markets.
|
72
|
+
email:
|
73
|
+
- amber.tunnell@gmail.com
|
74
|
+
executables: []
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- Gemfile
|
79
|
+
- Gemfile.lock
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- hybondnews.gemspec
|
84
|
+
- lib/hybondnews.rb
|
85
|
+
- lib/hybondnews/version.rb
|
86
|
+
- pkg/hybondnews-0.0.1.gem
|
87
|
+
homepage: ''
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.2.2
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: Web-scraping gem for High Yield Bond News
|
111
|
+
test_files: []
|