2017 © Pedro Peláez
 

library disqus

Disqus API simple usage in Laravel 4

image

escapeboy/disqus

Disqus API simple usage in Laravel 4

  • Tuesday, June 24, 2014
  • by escapeboy
  • Repository
  • 2 Watchers
  • 3 Stars
  • 74 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel 4 Disqus Package v0.1

Simple package to work with Disqus, (*1)

Installation

With composer:, (*2)

{
    ...
    "require": {
        "escapeboy/disqus": "dev-master"
    }
}

Register in app/config/app.php, (*3)

'providers' => array(
    'Escapeboy\Disqus\DisqusServiceProvider',
)

Configuration

Publish configuration file, (*4)

php artisan config:publish escapeboy/disqus

In app/config/packages/escapeboy/disqus/config.php edit configuration file:, (*5)

return array(
        'api_key' => '', // your disqus api key
        'api_secret' => '', // your disqus secret
        'api_version' => '3.0', // disqus API version used. Do not change it
        'cache_time' => 60, // cache time in minutes used to cache results
        'forum' => '' // your disqus forum (shortname)
    );

Usage

For example we want to get from API info for some thread We want section "thread", sub-section "details". And we provide "thread:link" (can use "thread:ident" or "thread") It will return json. More info here: http://disqus.com/api/docs/threads/details/, (*6)

// Disqus::get($section, $method, $params=array()
$thread = Disqus::get('threads', 'details', array('thread:link' => 'http://thread_url'));

Sending data to Disqus, (*7)

Disqus::post('posts', 'create', array('message' => 'Yo! Nice thread!', 'thread' => 12));

Some shorthand functions

$comment_count = Disqus::commentsCount('http://thread_url'); // returns integer of comments count for given url

... more functions comming in next releases, (*8)

The Versions

24/06 2014

dev-master

9999999-dev https://github.com/escapeboy/disqus

Disqus API simple usage in Laravel 4

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

laravel disqus comments