magicformulainvesting 1.0.0 → 1.1.0
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 +4 -4
- data/README.md +20 -12
- data/lib/magicformulainvesting.rb +3 -3
- data/lib/magicformulainvesting/company_quote.rb +10 -1
- data/lib/magicformulainvesting/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 372eecc22df8cda17d094c18db1971028ae1899b
|
4
|
+
data.tar.gz: e932a606720ccfb251dbaf6c7fe17c5866337679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c6b489e97470fcf1aab8eedfb95cfaf6f8be247140fbeece91c3b72dd0db3bffa188a8531c632bffcda974b079f958bb4bb1eb9383562f8aeb9fb9291a2dd08
|
7
|
+
data.tar.gz: f5d43c689f994eede48622db796aa10a9e0525283cd67bc8b8f343846b06a5b7399065f37f5a165bc4c5c6c9961d5d3b6c2e316b2c33ba4cd3ae0bc62c12b10d
|
data/README.md
CHANGED
@@ -5,18 +5,26 @@ I read [Little Book that Still Beats the Market](https://www.amazon.com/Little-B
|
|
5
5
|
So I wrote this little app to fetch the results and display them as a table to the terminal.
|
6
6
|
|
7
7
|
```
|
8
|
-
|
9
|
-
| Name |
|
10
|
-
|
11
|
-
| Accretive Health Inc | ACHI | 261.62 | 09/30 | 06/30
|
12
|
-
| Argan Inc | AGX | 889.74 | 09/30 | 07/31
|
13
|
-
| Avid Technology Inc. | AVID | 316.18 | 09/30 | 06/30
|
14
|
-
| Barrett Business Services Inc | BBSI | 357.69 | 09/30 | 06/30
|
15
|
-
| BP Prudhoe Bay Royalty Trust | BPT | 399.32 | 09/30 | 06/30
|
16
|
-
| Capella Education Co | CPLA | 673.67 | 09/30 | 06/30
|
17
|
-
| Cherokee Inc | CHKE | 89.73 | 09/30 | 07/31
|
18
|
-
| Cisco Systems Inc | CSCO | 158,790.30 | 09/30 | 07/31
|
19
|
-
| Deluxe Corp | DLX | 3,258.14 | 09/30 | 06/30
|
8
|
+
+----------------------------------+--------+------------+------------+---------------------+--------------------------------------+
|
9
|
+
| Name | Ticker | Market Cap | Price From | Recent Quarter Data | Overview |
|
10
|
+
+----------------------------------+--------+------------+------------+---------------------+--------------------------------------+
|
11
|
+
| Accretive Health Inc | ACHI | 261.62 | 09/30 | 06/30 | https://finance.yahoo.com/quote/ACHI |
|
12
|
+
| Argan Inc | AGX | 889.74 | 09/30 | 07/31 | https://finance.yahoo.com/quote/AGX |
|
13
|
+
| Avid Technology Inc. | AVID | 316.18 | 09/30 | 06/30 | https://finance.yahoo.com/quote/AVID |
|
14
|
+
| Barrett Business Services Inc | BBSI | 357.69 | 09/30 | 06/30 | https://finance.yahoo.com/quote/BBSI |
|
15
|
+
| BP Prudhoe Bay Royalty Trust | BPT | 399.32 | 09/30 | 06/30 | https://finance.yahoo.com/quote/BPT |
|
16
|
+
| Capella Education Co | CPLA | 673.67 | 09/30 | 06/30 | https://finance.yahoo.com/quote/CPLA |
|
17
|
+
| Cherokee Inc | CHKE | 89.73 | 09/30 | 07/31 | https://finance.yahoo.com/quote/CHKE |
|
18
|
+
| Cisco Systems Inc | CSCO | 158,790.30 | 09/30 | 07/31 | https://finance.yahoo.com/quote/CSCO |
|
19
|
+
| Deluxe Corp | DLX | 3,258.14 | 09/30 | 06/30 | https://finance.yahoo.com/quote/DLX |
|
20
|
+
```
|
21
|
+
|
22
|
+
For iTerm2/MacOS users, hold down Command key to open any URL into the browser.
|
23
|
+
|
24
|
+
To install using RubyGems:
|
25
|
+
|
26
|
+
```
|
27
|
+
gem install magicformulainvesting
|
20
28
|
```
|
21
29
|
|
22
30
|
To use, setup your email/password as environment variables:
|
@@ -29,7 +29,7 @@ module MagicFormulaInvesting
|
|
29
29
|
data = row.search("td")
|
30
30
|
quote = MagicFormulaInvesting::CompanyQuote.new
|
31
31
|
quote.name = data[0].text
|
32
|
-
quote.
|
32
|
+
quote.ticker = data[1].text
|
33
33
|
quote.market_cap = data[2].text
|
34
34
|
quote.price_from = data[3].text
|
35
35
|
quote.most_recent_quarter_data = data[4].text
|
@@ -37,9 +37,9 @@ module MagicFormulaInvesting
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
table = Terminal::Table.new :headings => ['Name', '
|
40
|
+
table = Terminal::Table.new :headings => ['Name', 'Ticker', 'Market Cap', 'Price From', 'Recent Quarter Data', 'Overview']
|
41
41
|
company_quotes.each do |quote|
|
42
|
-
table <<
|
42
|
+
table << quote.table_row
|
43
43
|
end
|
44
44
|
puts table
|
45
45
|
end
|
@@ -1,9 +1,18 @@
|
|
1
1
|
module MagicFormulaInvesting
|
2
2
|
class CompanyQuote
|
3
3
|
attr_accessor :name
|
4
|
-
attr_accessor :
|
4
|
+
attr_accessor :ticker
|
5
5
|
attr_accessor :market_cap
|
6
6
|
attr_accessor :price_from
|
7
7
|
attr_accessor :most_recent_quarter_data
|
8
|
+
|
9
|
+
def overview_link
|
10
|
+
"https://finance.yahoo.com/quote/#{ticker}"
|
11
|
+
end
|
12
|
+
|
13
|
+
def table_row
|
14
|
+
[name, ticker, market_cap, price_from, most_recent_quarter_data, overview_link]
|
15
|
+
end
|
16
|
+
|
8
17
|
end
|
9
18
|
end
|