finviz_rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07733b1234ed0a79d791281010bf08d12e7e4eca
4
- data.tar.gz: 92dab6859ad5ebbb019c88eb90365e5fbf799650
3
+ metadata.gz: 066eeb06e6776516c903b05798b6ce55ba6518d8
4
+ data.tar.gz: b1c0800b0a5be8a9231be57a867e0161d70362cd
5
5
  SHA512:
6
- metadata.gz: e2a3d0898554e8966331c917e1e0efe9240881af34fece36aabcfec8497b2eb65ab659c844df4f4eef793c298dce309cd0ab4a21650f4e1f5bbb248fc32f4576
7
- data.tar.gz: 0a3bc1346d1002ee58d27c5022096e91d104d1c526181bf5ddc85afe07fb5ed94071127c45f9d93b81b2d153b266ed8df296a95a36effb8a65c4f9c92a1c1abd
6
+ metadata.gz: f465dc6fc3000e81c8799a04df7a79437841407fc3645916df8886c0ea1910ef6c0777853bb4f01065ca812d15bf912b9520faf29c728d8fcbde5ba8a9452b3d
7
+ data.tar.gz: 16efb469e94658782d85f3662173a14894b6782daf82be48e8e7e6eb2cbbf8eec1f6c4dfe8cca375eb6934d328c804ec638758b3a766d7a25f491307ca8f1e8f
@@ -21,7 +21,7 @@ class Finviz
21
21
  end
22
22
 
23
23
  def url(params)
24
- UrlFormatter.new(nil, nil, params).run
24
+ UrlFormatter.new(nil, nil, params, nil).run
25
25
  end
26
26
 
27
27
  private
@@ -72,7 +72,12 @@ class Screener
72
72
  header.gsub('.','').gsub('/','_').gsub(' ','').downcase
73
73
  end
74
74
 
75
+ def row_limit
76
+ found_count = @agent.page.content.match(/var portfolioRowsLimit=(\d+)/)
77
+ found_count ? found_count[1].to_i : nil
78
+ end
79
+
75
80
  def url(page=nil)
76
- UrlFormatter.new(@auth, page, @params).run
81
+ UrlFormatter.new(@auth, page, @params, row_limit).run
77
82
  end
78
83
  end
@@ -1,13 +1,14 @@
1
1
  class UrlFormatter
2
- def initialize(auth, page, params)
2
+ def initialize(auth, page, params, row_limit)
3
3
  @auth = auth
4
4
  @page = page
5
5
  @params = params
6
+ @row_limit = row_limit
6
7
  end
7
8
 
8
9
  def run
9
10
  if @page
10
- stock_num = ((@page * 20) + 1) - 20
11
+ stock_num = ((@page * @row_limit) + 1) - @row_limit
11
12
  else
12
13
  stock_num = 0
13
14
  end
@@ -1,3 +1,3 @@
1
1
  module FinvizRails
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -499,5 +499,51 @@ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
499
499
   (0.1ms) begin transaction
500
500
  --------------------------------------------------------------
501
501
  FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
502
+ --------------------------------------------------------------
503
+  (0.1ms) rollback transaction
504
+  (0.1ms) begin transaction
505
+ --------------------------------------------------------------
506
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
507
+ --------------------------------------------------------------
508
+  (0.1ms) rollback transaction
509
+  (0.1ms) begin transaction
510
+ --------------------------------------------------------------
511
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
512
+ --------------------------------------------------------------
513
+  (0.1ms) begin transaction
514
+ --------------------------------------------------------------
515
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
516
+ --------------------------------------------------------------
517
+  (0.2ms) rollback transaction
518
+  (0.1ms) begin transaction
519
+ --------------------------------------------------------------
520
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
521
+ --------------------------------------------------------------
522
+  (0.1ms) begin transaction
523
+ --------------------------------------------------------------
524
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
525
+ --------------------------------------------------------------
526
+  (0.1ms) rollback transaction
527
+  (0.1ms) begin transaction
528
+ --------------------------------------------------------------
529
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
530
+ --------------------------------------------------------------
531
+  (0.1ms) begin transaction
532
+ --------------------------------------------------------------
533
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
534
+ --------------------------------------------------------------
535
+  (0.1ms) rollback transaction
536
+  (0.1ms) begin transaction
537
+ --------------------------------------------------------------
538
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
539
+ --------------------------------------------------------------
540
+  (0.1ms) begin transaction
541
+ --------------------------------------------------------------
542
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
543
+ --------------------------------------------------------------
544
+  (0.1ms) rollback transaction
545
+  (0.1ms) begin transaction
546
+ --------------------------------------------------------------
547
+ FinvizRailsTest: test_non-auth_screener_get_first_page_of_data
502
548
  --------------------------------------------------------------
503
549
   (0.1ms) rollback transaction
@@ -5,9 +5,11 @@ class FinvizRailsTest < ActiveSupport::TestCase
5
5
  test "non-auth screener get first page of data" do
6
6
  finviz = Finviz.new
7
7
  pp finviz.screener(
8
- # analyst_recommendation: "strongbuy",
9
- is_active: true,
10
- max_stock_count: 1
8
+ price_range: "2to3",
9
+ analyst_recommendation: "strongbuy",
10
+ average_volume: "o50",
11
+ pattern: "wedgedown",
12
+ is_active: true
11
13
  )
12
14
  end
13
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finviz_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nemrow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-03 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails