This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install dj2-postrank
dan sinclair (author)
Wed Dec 03 11:06:30 -0800 2008
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Jul 16 18:30:43 -0700 2008 | [dj2] |
| |
COPYING | Tue Jul 15 19:19:13 -0700 2008 | [dj2] |
| |
README.rdoc | Wed Dec 03 11:06:30 -0800 2008 | [dan sinclair] |
| |
Rakefile | Sat Nov 08 22:23:58 -0800 2008 | [dj2] |
| |
examples/ | Sat Nov 29 17:29:31 -0800 2008 | [dj2] |
| |
lib/ | Sat Nov 29 17:29:31 -0800 2008 | [dj2] |
| |
postrank.gemspec | Sat Nov 29 17:29:31 -0800 2008 | [dj2] |
README.rdoc
= Ruby PostRank
A simple wrapper around the PostRank.com REST API. I've tried to keep the
API simple without it being a bare API wrapper.
= Dependencies
You will need the OAuth gem installed in order to use Ruby PostRank.
- sudo gem install oauth
= Walkthrough
I've tried to keep the API as simple as possible. It's about one step above
the bare PostRank API. Hopefully the added abstraction is useful. The
easiest way to explain this is probably to show an example. So, here we go.
#!/usr/bin/env ruby
require 'rubygems'
require 'postrank'
include PostRank
conn = Connection.instance
conn.appkey = "everburning.com/ruby-postrank"
eb = Feed.find_by_url("http://everburning.com")
puts "The GREAT everburning feeds"
eb.entries(:level => Level::GREAT).each do |entry|
puts entry
end
puts "\nThe top 5 posts in the last week on everburning"
eb.topposts(:period => Period::WEEK).each do |entry|
puts "#{entry.title} -- #{entry.postrank} -- #{entry.postrank_color}"
end
puts "\nGet thematic PostRanked items"
PostRank::PostRank.calculate(["http://flickr.com/photos/14009462@N00/2654539960/",
"http://www.flickr.com/photos/21418584@N07/2447928272/",
"http://www.flickr.com/photos/pilou/2655293624/"]).each do |entry|
puts "#{entry.original_link} #{entry.postrank}"
end
puts "\nGet PostRanked items"
PostRank::PostRank.calculate(['http://everburning.com/news/on-recent-media/',
'http://everburning.com/news/californication/',
'http://everburning.com/news/the-weary-traveler/'],
:feeds => [eb]).each do |entry|
puts "#{entry.original_link} #{entry.postrank}"
end
That's basically it.
= Contact
If you've got any questions, comments or bugs, please let me know. You can
contact me by email at dan at aiderss dot com.





