README.md in PageRankr-1.6.0 vs README.md in PageRankr-1.7.0
- old
+ new
@@ -35,10 +35,32 @@
You can also use the alias `backlink` instead of `backlinks`.
Valid search engines are: `:google, :bing, :yahoo, :altavista, :alltheweb, :alexa`. To get this list you can do:
PageRankr.backlink_trackers #=> [:alexa, :alltheweb, :altavista, :bing, :google, :yahoo]
+### Indexes
+
+Indexes are the result of doing a search with a query like "site:www.google.com". The number of returned results indicates how many pages of a domain are indexed by a particular search engine.
+
+ PageRankr.indexes('www.google.com', :google) #=> {:google=>4860000}
+ PageRankr.indexes('www.google.com', :bing) #=> {:bing=>2120000}
+
+If you don't specify a search engine, then all of them are used.
+
+ # this
+ PageRankr.indexes('www.google.com')
+ #=> {:bing=>2120000, :google=>4860000}
+
+ # is equivalent to
+ PageRankr.indexes('www.google.com', :google, :bing)
+ #=> {:bing=>2120000, :google=>4860000}
+
+You can also use the alias `index` instead of `indexes`.
+Valid search engines are: `:google, :bing`. To get this list you can do:
+
+ PageRankr.index_trackers #=> [:alexa, :alltheweb, :altavista, :bing, :google, :yahoo]
+
### Ranks
PageRankr.ranks('www.google.com', :alexa, :google) #=> {:alexa=>{:us=>1, :global=>1}, :google=>10}
# this also gives the same result
@@ -55,11 +77,11 @@
## Fix it!
If you ever find something is broken it should now be much easier to fix it with version >= 1.3.0. For example, if the xpath used to lookup a backlink is broken, just override the method for that class to provide the correct xpath.
module PageRankr
- class Backlinks
+ class Backlinks < Tracker
class Google < Backlink
def xpath
"my new awesome xpath"
end
end
@@ -69,11 +91,11 @@
## Extend it!
If you ever come across a site that provides a rank or backlinks you can hook that class up to automatically be use with PageRankr.
module PageRankr
- class Backlinks
+ class Backlinks < Tracker
class Foo < Backlink
def url(site)
"http://example.com/?q=#{site}"
end
@@ -103,12 +125,10 @@
## TODO Version 2
* Use API's where possible
* Use [Typhoeus](https://github.com/pauldix/typhoeus) to improve speed when requesting multiple ranks and/or backlinks
* Configuration
- * API keys
- * Alexa rank options
-* Add compete rank tracker
+ * Optionally use API keys
## Contributors
* [Druwerd](http://github.com/Druwerd) - Use Google Search API instead of scraping.
## Shout Out
\ No newline at end of file