Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ideaoforder-acts_as_disqusable
Advanced tools
== Acts-As-Disqusable Ruby Gem
The Acts-As-Disqusable Gem helps you easily integrate the {Disqus}[http://disqus.com] commenting system into your website. It should work for any site programmed in Ruby.
It's a fork of Norman Clarke's Disqus Gem and incorporates Thomas Reynolds's DisqusParty changes (namely, switching to HTTParty and using Jeweler for gem creation, as well as ditching the view helpers).
Disqus API support is "beta." Right now we're using API version 1.1.
=== 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 ideaoforder-acts_as_disqusable
=== Use it:
class YOUR_MODEL acts_as_disqusable end
class YOUR_MODEL acts_as_disqusable, :forum_id => X, :forum_shortname => X, :forum_api_key => X end
class YOUR_MODEL # title, slug, and thread_id default to title, slug, and thread_id...surprise! acts_as_disqusable, :title_column => 'name', :slug_column => 'permalink', :thread_id => 'your_mom', :prefix => false # this defaults to the associated controller # so Post would create a link like: '/posts/slug/ # you can set this to false for just: '/slug' # or to a different path: '/blog/slug' end
OPTIONAL: You should create a :thread_id field in the database for each model that is disqusable. This will result in fewer requests to Disqus. Everything but YOUR_MODEL.comment_count() should work without it.
==== Configure it:
===== Example - This goes in config/disqus.yml: - :api_key: YOUR_API_KEY - :account: YOUR_ACCOUNT_NAME - :developer: true or false
If you're only connecting 1 forum to your site:
- :forum_api_key: YOUR_FORUM_API_KEY
- :forum_id: YOUR_FORUM_ID
- :forum_shortname: YOUR_FORUM_SHORTNAME
Otherwise, the forum info goes in the model that's disqusable.
You could use a different forum for each model.
It would be better to use the new category feature, however.
Sadly, I haven't had time to program that yet.
===== Options
:api_key => "" # your api key :account => "", # your disqus account :developer => false, # allows for threads to work on localhost if set to true :container_id => 'disqus_thread', # desired thread container :avatar_size => 48, # squared pixel size of avatars :num_items => 5, # number of comments to display / this is just the default :forum_api_key => "" # your forum api key :forum_id => "" # your forum id :forum_shortname => "" # your forum shortname
==== To get your forum info, in the console:
f = Disqus::Forum.all
f.first.id f.first.key f.first.shortname
==== So:
Let's say Post are disqusable.
Then
Post.comments(:limit => 5, :exclude => 'spam') # class level
Will grab the 5 most recent non-spam comments. The default
limit and exclude are 5 and 'spam'.
@post.comments
Will grab the comments for a post.
@post.comment_count
Will grab the number of comments for a given post.
@post.comment_form
Will create a comment form appropriate to the @post. This still uses the
older javascript form.
==== There are lots of other options for Threads/Forums etc.
==== 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}[http://disqus.com/docs/api/].
=== Hack it:
Github repository:
http://github.com/ideaoforder/acts_as_disqusable/
=== Learn more about Disqus:
{http://disqus.com}[http://disqus.com]
=== Thanks to the following contributors:
=== 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 {Mark Dickson}[mailto:mark@sitesteaders.com], released under the MIT license
FAQs
Unknown package
We found that ideaoforder-acts_as_disqusable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.