github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

norman / disqus

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 87
    • 12
  • Source
  • Commits
  • Network (12)
  • Issues (0)
  • Downloads (3)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • api
    • master ✓
  • Tags (3)
    • 1.0.2
    • 1.0.1
    • 1.0.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A Ruby library for the Disqus commenting API and Javascript widgets. — Read more

  cancel

http://disqus.rubyforge.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Removed now useless Github gemspec. 
norman (author)
Mon Oct 19 12:25:16 -0700 2009
commit  860ca92dc5591fdd61a1e202357a859316522257
tree    5d39528bcc3fb41fddc9b881ef50468e5dadb2c4
parent  82b51a919b3ef6ed62c54fec61b5e32b2e4d0c8e
disqus /
name age
history
message
file .gitignore Sat Jan 17 12:31:07 -0800 2009 Fix up manifest and gemspec to ignore config.ym... [qhoxie]
file History.txt Mon Oct 05 08:14:34 -0700 2009 Release notes for 1.0.2 [nbudin]
file MIT-LICENSE Tue Aug 26 13:05:52 -0700 2008 Initial commit. [Norman Clarke]
file Manifest.txt Mon Oct 19 12:26:06 -0700 2009 Removed now useless Github gemspec. [norman]
file README.rdoc Sat Jan 17 12:31:09 -0800 2009 Update readme to reflect merb example and avail... [qhoxie]
file Rakefile Mon Oct 19 12:24:02 -0700 2009 Bumped version and updated contact info. [norman]
directory config/ Mon Jan 05 07:58:13 -0800 2009 Reorganized files to use newgem. [Norman Clarke]
file init.rb Mon Jan 05 07:58:13 -0800 2009 Reorganized files to use newgem. [Norman Clarke]
directory lib/ Mon Oct 19 12:24:22 -0700 2009 Merge branch 'nbudin' [norman]
directory tasks/ Mon Jan 05 07:58:13 -0800 2009 Reorganized files to use newgem. [Norman Clarke]
directory test/ Mon Jan 05 07:58:13 -0800 2009 Reorganized files to use newgem. [Norman Clarke]
README.rdoc

Disqus Ruby Gem

The Disqus Gem helps you easily integrate the Disqus commenting system into your website. It works for any site programmed in Ruby, and has view helpers for Rails and Merb.

Support for the Disqus Javascript widgets is stable. Disqus API support is "beta."

What is Disqus?

From the Disqus website:

"Disqus, pronounced "discuss", is a service and tool for web comments and discussions. The Disqus comment system can be plugged into any website, blog, or application. Disqus makes commenting easier and more interactive, while connecting websites and commenters across a thriving discussion community."

"Disqus is a free service to the general public with absolutely no inline advertisements."

Get it

  gem install disqus

Bleeding Edge

  gem install norman-disqus  --source http://gems.github.com

Use it:

Configure it:

Generic example:
  Disqus::defaults[:account] = "my_disqus_account"
  # Optional, only if you're using the API
  Disqus::defaults[:api_key] = "my_disqus_api_key"
Rails example:
  # in config/development.rb (or production.rb, test.rb, etc.)
  config.after_initialize do
    Disqus::defaults[:account] = "my_disqus_account"
    # Optional, only if you're using the API
    Disqus::defaults[:api_key] = "my_disqus_api_key"
  end

Note that here the "after initialize" is necessary, otherwise your settings won’t be set properly.

Merb example:
  # in config/init.rb
  Merb::BootLoader.after_app_loads do
    Disqus::defaults[:account] = "my_disqus_account"
    # Optional, only if you're using the API
    Disqus::defaults[:api_key] = "my_disqus_api_key"
  end

Note that here the "after_app_loads" is necessary, otherwise your settings won’t be set properly.

Options
  :api_key => "" # your api key
  :account => "", # your disqus account
  :developer => false, # allows for threads to work on localhost
  :container_id => 'disqus_thread', # desired thread container
  :avatar_size => 48, # squared pixel size of avatars
  :color => "grey", # theme color
  :default_tab => "popular", # default widget tab
  :hide_avatars => false, # hide or show avatars
  :hide_mods => true, # hide or show moderation
  :num_items => 15, # number of comments to display
  :show_powered_by => true, # show or hide powered by line
  :orientation => "horizontal" # comment orientation

Show the comment threads widget on a post page:

  # 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

Show the combo widget on a post page:

  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)

Show the comment count on a permalink:

  link_to("Permalink", post_path(@post, :anchor => "disqus_thread"))
  ...
  disqus_comment_counts

  # Or for non-Rails/Merb:
  Disqus::Widget::comment_counts

Work with the Disqus API:

See the Disqus::Api class for more info on the Disqus API. You can also read the Disqus developer info here.

Hack it:

Github repository:

  http://github.com/norman/disqus

Submit bug reports:

Please use our Lighthouse.

Learn more about Disqus:

disqus.com

Thanks to the following contributors:

  • Matt Van Horn - Disqus API
  • Quin Hoxie - Merb support

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 © 2008 Norman Clarke, released under the MIT license

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server