Welcome Guest, Not a member yet? Register   Sign In
Digg API Library - Flame
#1

[eluser]Jamie Rumbelow[/eluser]
This library allows you to connect to Digg’s API and pull the latest stories, diggs, user information, photos and more. It is fully compatible with the Digg API spec, so any action you see on the Digg API Docs can be done in this library.

<b>Requirements</b>
1. PHP5.1+
2. cURL Extension
3. SimpleXML Extension (For the XML response type)

<b>Usage</b>
Start by loading the class:

Code:
//CI
$this->load->library("digg");

//Non-CI
require 'digg.php';
$DIGG = new Digg("http://your_apps_url_here.com");

If you are using CodeIgniter, the class will automatically pick up the base_url setting from the config file. Now, you can call the API methods using the wrapper methods for each. These will return an object.

Code:
//CI
$stories = $this->digg->stories(10);

//Non-CI
$stories = $DIGG->stories(10);

foreach ($stories->stories as $story):

echo $story->title;

endforeach;

<b>Functions</b>
A total list of functions can be found in the Digg API Doc.

<b>Download</b>
You can download the latest version, along with all my other libraries by cloning the Git repository <a href="http://github.com/jamierumbelow/flare/tree/master">stored on GitHub</a>. You can also find a <a href="http://jamierumbelow.net/code">.zip of the class and the readme file on my website.</a>

License
The entire Flame repo is licensed under GNU-GPL.

Enjoy!




Theme © iAndrew 2016 - Forum software by © MyBB