dummy_files

Pull urls of random images/files from google searches to generate sample data.

Installation

sudo gem install dummy_files

In your config/environment.rb

config.gem 'dummy_files', :version => '=>0.0.9'

To get Images

DummyFiles::Images.get

You can also call pass parameters

DummyFiles::Images.get(number, keyword, content)

Where number is the number of images to fetch (by default 100), keyword is the keyword for the google search (by default “me”) and content is the type of images, which can be “any” (ie, any image) or “face” (ie, pictures of faces, this is the default value).

You can get a single image, too

DummyFiles::Image.get

Or with parameters

DummyFiles::Image.get(keyword, content)

To get Files

DummyFiles::Files.get(filetype)

So you are gonna be searching for files whose file type is “filetype”.

Call with parameters

DummyFiles::Files.get(filetype, number, keyword)

By default keyword is “”.

Single File

DummyFiles::File.get(filetype)

With parameters

DummyFiles::File.get(filetype, keyword)

API

There’s an API avalailable in my website, it returns the results as text/JSON. The calls are as follows:

Images

http://api.jordinl.com/dummy/images

Images with params

http://api.jordinl.com/dummy/images?number=[YOUR_NUMBER]&keyword=[YOUR_KEYWORD]&content=[YOUR_CONTENT]

Image

http://api.jordinl.com/dummy/image

Image with params

http://api.jordinl.com/dummy/image?keyword=[YOUR_KEYWORD]&content=[YOUR_CONTENT]

Files

http://api.jordinl.com/dummy/files?filetype=[YOUR_FILETYPE]

Files with params

http://api.jordinl.com/dummy/files?filetype=[YOUR_FILETYPE]&keyword=[YOUR_KEYWORD]&number=[YOUR_NUMBER]

File

http://api.jordinl.com/dummy/file?filetype=[YOUR_FILETYPE]

File with params

http://api.jordinl.com/dummy/file?filetype=[YOUR_FILETYPE]&keyword=[YOUR_KEYWORD]

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Jordi Noguera. See LICENSE for details.