https://github.com/escapeboy/disqus
Laravel 4 Disqus Package
https://github.com/escapeboy/disqus
Last synced: about 1 month ago
JSON representation
Laravel 4 Disqus Package
- Host: GitHub
- URL: https://github.com/escapeboy/disqus
- Owner: escapeboy
- Created: 2014-04-13T13:46:52.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-24T16:58:01.000Z (almost 12 years ago)
- Last Synced: 2025-04-25T19:11:37.393Z (about 1 year ago)
- Language: PHP
- Size: 223 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Laravel 4 Disqus Package v0.1
======
Simple package to work with Disqus
Installation
======
With composer:
```
{
...
"require": {
"escapeboy/disqus": "dev-master"
}
}
```
Register in `app/config/app.php`
```php
'providers' => array(
'Escapeboy\Disqus\DisqusServiceProvider',
)
```
Configuration
======
Publish configuration file
```
php artisan config:publish escapeboy/disqus
```
In `app/config/packages/escapeboy/disqus/config.php` edit configuration file:
```php
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/](http://disqus.com/api/docs/threads/details/)
```php
// Disqus::get($section, $method, $params=array()
$thread = Disqus::get('threads', 'details', array('thread:link' => 'http://thread_url'));
```
Sending data to Disqus
```php
Disqus::post('posts', 'create', array('message' => 'Yo! Nice thread!', 'thread' => 12));
```
Some shorthand functions
======
```php
$comment_count = Disqus::commentsCount('http://thread_url'); // returns integer of comments count for given url
```
*... more functions comming in next releases*