PageRankr 1.7.0 → 1.7.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.
@@ -1,4 +1,7 @@
1
1
  # Change Log
2
+ ## Version 1.7.1
3
+ * Catches exception thrown when doing compete rank lookup with url not in the form "google.com".
4
+
2
5
  ## Version 1.7.0
3
6
  * Merged in additions from iteration labs to add compete rank tracker and domain indexes.
4
7
 
data/README.md CHANGED
@@ -5,7 +5,7 @@ Provides an easy way to retrieve Google Page Rank, Alexa Rank, and backlink coun
5
5
  Check out a little [web app][1] I wrote up that uses it or look at the [source][2].
6
6
 
7
7
  [1]: http://isitpopular.heroku.com
8
- [2]: http://github.com/blatyo/is_it_popular
8
+ [2]: https://github.com/blatyo/is_it_popular
9
9
 
10
10
  ## Get it!
11
11
 
@@ -61,15 +61,17 @@ Valid search engines are: `:google, :bing`. To get this list you can do:
61
61
 
62
62
  ### Ranks
63
63
 
64
- PageRankr.ranks('www.google.com', :alexa, :google) #=> {:alexa=>{:us=>1, :global=>1}, :google=>10}
64
+ __Note: Compete only accepts urls in the form of "google.com" and not "www.google.com". If the latter is given, a value of 0 will be returned. This will be fixed in version 2 of PageRankr.__
65
+
66
+ PageRankr.ranks('google.com', :alexa, :google, :compete) #=> {:alexa=>{:us=>1, :global=>1}, :google=>10, :compete=>1}
65
67
 
66
68
  # this also gives the same result
67
- PageRankr.ranks('www.google.com') #=> {:alexa=>{:us=>1, :global=>1}, :google=>10}
69
+ PageRankr.ranks('google.com') #=> {:alexa=>{:us=>1, :global=>1}, :google=>10, :compete=>1}
68
70
 
69
71
  You can also use the alias `rank` instead of `ranks`.
70
- There are two valid rank trackers supported: `:alexa, :google`. To get this you can do:
72
+ There are three valid rank trackers supported: `:alexa, :google, :compete`. To get this you can do:
71
73
 
72
- PageRankr.rank_trackers #=> [:alexa, :google]
74
+ PageRankr.rank_trackers #=> [:alexa, :google, :compete]
73
75
 
74
76
  Alexa ranks are descending where 1 is the most popular. If a site has an alexa rank of 0 then the site is unranked.
75
77
  Google page ranks are in the range 0-10 where 10 is the most popular. If a site is unindexed then the rank will be -1.
@@ -130,14 +132,16 @@ Then, just make sure you require the class and PageRankr and whenever you call P
130
132
  * Optionally use API keys
131
133
 
132
134
  ## Contributors
133
- * [Druwerd](http://github.com/Druwerd) - Use Google Search API instead of scraping.
135
+ * [Druwerd](https://github.com/Druwerd) - Use Google Search API instead of scraping.
136
+ * [Iteration Labs](https://github.com/iterationlabs) - Compete rank tracker and domain indexes.
134
137
 
135
138
  ## Shout Out
136
139
  Gotta give credit where credits due!
137
140
 
138
- * [http://github.com/alexmipego/PageRankSharp](http://github.com/alexmipego/PageRankSharp)
139
- * [http://snipplr.com/view/18329/google-page-range-lookup/](http://snipplr.com/view/18329/google-page-range-lookup/)
140
- * [http://www.sitetoolcenter.com/free-website-scripts/ajax-pr-checker.php](http://www.sitetoolcenter.com/free-website-scripts/ajax-pr-checker.php)
141
+ Original inspiration from:
142
+ * [PageRankSharp](https://github.com/alexmipego/PageRankSharp)
143
+ * [Google Page Range Lookup/](http://snipplr.com/view/18329/google-page-range-lookup/)
144
+ * [AJAX PR Checker](http://www.sitetoolcenter.com/free-website-scripts/ajax-pr-checker.php)
141
145
 
142
146
  ## Copyright
143
147
 
@@ -7,6 +7,8 @@ module PageRankr
7
7
  class Compete < Rank
8
8
  def initialize(site)
9
9
  @rank = Nokogiri::HTML(open(url(site))).search(xpath).to_s.gsub(',', '').to_i
10
+ rescue
11
+ @rank = 0 #compete only accepts urls without http:// and www, will be fixed in 2.0
10
12
  end
11
13
 
12
14
  def xpath
@@ -1,3 +1,3 @@
1
1
  module PageRankr
2
- VERSION = "1.7.0"
2
+ VERSION = "1.7.1"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 7
8
- - 0
9
- version: 1.7.0
8
+ - 1
9
+ version: 1.7.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Allen Madsen