Skip to content

johnyerhot/rdigg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rdigg
=====

Digg API wrapper in a Rails plugin.  

Currently living at 
	git://github.com/johnyerhot/rdigg.git
	
Setup
=====

Create a Rdigg config YAML file in your applications config directory
	rake rdigg_setup
	
Be sure to replace api_key with your application's uri. 

API Keys
=======
Digg needs you to use an API key.  This should be your application's URI.
You can change the API Key by changing @api_key (see above) to your key.

More information available at
	http://apidoc.digg.com/ApplicationKeys
	
Arguments
=========
Digg's API lets you specify many arguments to filter the requested data.  Depending on what you are requesting, the arguments can differ.  Eventually, I'll document exactly which arguments work with each method.

Arguments get supplied as a symbol. For example:
	digg.stories.find(:count => 3)
	
If the method requires a parameter, that should be supplied first. For example:
	digg.user.find_submissions("kevinrose", :count => 3)
	

The common arguments that work on the majority of methods include:
	* :count => 5 # only returns 5 results
	* :offset => 30 # skips the first 30 results
	* :sort => object_type-asc, or object_type-desc # how to sort the results.  Substitute object_type for the object type you're searching for.
	
You really should go over Digg's API wiki to see exactly what arguments and how they should be supplied.

Example
=======

	digg = Rdigg.new
	stories = digg.user.find_submissions("kevinrose", :count => 3)  # => returns an array containing the results in a hash.
    stories.first[:story] # => story text


Digg returns a lot of attributes relating to what you're looking for.  Each of these are stored in the returned hash.

	stories.first[:diggs] # => number of diggs the story has.


Copyright (c) 2008 John Yerhot, released under the MIT license

About

Digg API wrapper in a Rails plugin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages