This repository has been archived by the owner on Dec 5, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated README with info on new API code. Bumped gem version.
- Loading branch information
Norman Clarke
committed
Dec 9, 2008
1 parent
e96b2e0
commit 9a03d70
Showing
2 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
h1. Disqus Ruby Gem | ||
|
||
The Disqus Gem helps you easily integrate the "Disqus":http://disqus.com | ||
commenting system into your website. It works for any site programmed in Ruby, | ||
and has view helpers for Rails and Merb. | ||
|
||
Supports for the Disqus Javascript widgets is stable. Disqus API support is | ||
"beta." | ||
|
||
h2. Get it | ||
|
||
h3. Stable release (does not yet include API): | ||
|
||
<code> | ||
gem install disqus | ||
</code> | ||
|
||
h3. Bleeding Edge (includes API): | ||
|
||
<code> | ||
gem install norman-disqus --source http://gems.github.com | ||
</code> | ||
|
||
h2. Use it: | ||
|
||
h3. Configure it: | ||
|
||
h4. Generic example: | ||
|
||
<pre> | ||
<code> | ||
Disqus::defaults[:account] = "my_account" | ||
Disqus::defaults[:api_key] = "my_api_key_from_disqus" | ||
</code> | ||
</pre> | ||
|
||
h4. Rails-specific example: | ||
|
||
<pre> | ||
<code> | ||
# in config/development.rb (or production.rb, test.rb, etc.) | ||
config.after_initialize do | ||
Disqus::defaults[:account] = "my_disqus_account" | ||
end | ||
</code> | ||
</pre> | ||
Note that here the "after initialize" is necessary, otherwise your settings | ||
won't be set properly. | ||
|
||
|
||
h3. Show the comment threads on a post page: | ||
|
||
<pre> | ||
<code> | ||
# Loads the commenting system | ||
disqus_thread | ||
|
||
# Or if you're not using Rails/Merb: | ||
Disqus::Widget::thread | ||
|
||
# Sets the inner html to the comment count for any links on the page that | ||
# have the anchor "disqus_thread". For example, "View Comments" below would | ||
# be replaced by "1 comment" or "23 comments" etc. | ||
# <a href="http://my.website/article-permalink#disqus_thread">View Comments</a> | ||
# <a href="http://my.website/different-permalink#disqus_thread">View Comments</a> | ||
disqus_comment_counts | ||
|
||
# Or if you're not using Rails/Merb: | ||
Disqus::Widget::comment_counts | ||
</code> | ||
</pre> | ||
|
||
h3. Show the combo widget on a post page: | ||
|
||
<pre> | ||
<code> | ||
disqus_combo(:color => "blue", :hide_mods => false, :num_items => 20) | ||
|
||
# Or for non-Rails/Merb: | ||
Disqus::Widget::combo(:color => "blue", :hide_mods => false, :num_items => 20) | ||
</code> | ||
</pre> | ||
|
||
h3. Show the comment count on a permalink: | ||
|
||
<pre> | ||
<code> | ||
link_to("Permalink", post_path(@post, :anchor => "disqus_thread")) | ||
... | ||
disqus_comment_counts | ||
|
||
# Or for non-Rails/Merb: | ||
Disqus::Widget::comment_counts | ||
</code> | ||
</pre> | ||
|
||
h2. Hack it: | ||
|
||
Github repository: http://github.com/norman/disqus | ||
|
||
h2. Complain about it: | ||
|
||
"norman@randomba.org":norman@randomba.org | ||
|
||
h2. Learn more about Disqus: | ||
|
||
"http://disqus.com":http://disqus.com | ||
|
||
h2. Thanks to the following contributors: | ||
|
||
* "Matt Van Horn":http://github.com/qhoxie - Disqus API | ||
* "Quin Hoxie":http://github.com/qhoxie - Merb support | ||
|
||
h2. Legal Stuff | ||
|
||
The Disqus Ruby gem was not created by, nor is officially supported by | ||
Disqus.com or Big Head Labs, Inc. Use it at your own risk and your own | ||
responsibility under the terms of the MIT License. | ||
|
||
Copyright (c) 2008 "Norman Clarke":norman@randomba.org, released under | ||
the MIT license |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters