Git Product home page Git Product logo

rdigg's Introduction

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

rdigg's People

Contributors

johnyerhot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mattistrading

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.