Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/willrax/toppr

Ruby wrapper for desktoppr.co API.
https://github.com/willrax/toppr

Last synced: 9 days ago
JSON representation

Ruby wrapper for desktoppr.co API.

Awesome Lists containing this project

README

        

# Toppr [![Build Status](https://secure.travis-ci.org/willrax/toppr.png?branch=master)][travis]

[travis]: http://travis-ci.org/willrax/toppr

A simple ruby wrapper for the desktoppr.co API.

## Installation

$ gem install toppr

## Examples

Each request returns a hash with method access.

### Request a users profile

```ruby
Toppr.user('willrax')
=> #
```

### Wallpapers

You can fetch all the wallpapers on the desktoppr database

```ruby
Toppr.wallpapers
```

Or you can fetch a random wallpaper

```ruby
Toppr.random
=> # thumb=# url="http://a.desktopprassets.com/wallpapers/bddef83d0dd366676a0c9977eecd2d06560d7231/wp_2560-3.jpeg"> palette=[] review_state="safe" url="http://www.desktoppr.co/wallpapers/76285" user_count=6 user_id=5286 views_count=15 width=2560>
```

You can also add a username param to fetch either all the wallpapers that a user has in their collection or a random one.

```ruby
Toppr.wallpapers('willrax')
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request