# encoding: utf-8 module Nokaya class App < Thor package_name "Nokaya" %w{basic status movie workers instagram favd adn tumblr tumblr_album imgur_album flickr_album photonet deviantart imageshack_user}.each {|file| require_relative "#{file}"} desc "movie TITLE", "Get the movie poster from IMDb (nokaya -m url)" map "-m" => :movie option :name, aliases: "-n", type: :string, desc: "Specify a file name without extension" option :output, aliases: "-o", type: :string, desc: "Specify an output path" option :alt, aliases: "-a", type: :boolean, desc: "Find an alternative response" def movie *args puts Status.wait image = Movie.new(args, options) image.save puts Status.saved(image) end desc "instagram URL", "Get the original picture from an Instagram page (nokaya -i url)" map "-i" => :instagram option :name, aliases: "-n", type: :string, desc: "Specify a file name without extension" option :output, aliases: "-o", type: :string, desc: "Specify an output path" def instagram *args puts Status.wait image = Instagram.new(args, options) image.save puts Status.saved(image) end desc "favd URL", 'Get the picture from a Favd page (nokaya favd url)' option :name, aliases: "-n", type: :string, desc: "Specify a file name without extension" option :output, aliases: "-o", type: :string, desc: "Specify an output path" def favd *args puts Status.wait image = Favd.new(args, options) image.save puts Status.saved(image) end desc "adn URL", "Get the picture from a photos.app.net page (nokaya adn url)" option :name, aliases: "-n", type: :string, desc: "Specify a file name without extension" option :output, aliases: "-o", type: :string, desc: "Specify an output path" def adn *args puts Status.wait image = ADN.new(args, options) image.save puts Status.saved(image) end desc "tumblr URL", "Get the picture from a Tumblr post (nokaya -tu url)" map "-tu" => :tumblr option :name, aliases: "-n", type: :string, desc: "Specify a file name without extension" option :output, aliases: "-o", type: :string, desc: "Specify an output path" def tumblr *args puts Status.wait image = Tumblr.new(args, options) image.save puts Status.saved(image) end desc "tumblr_album URL", "Get all pictures from a Tumblr page (nokaya -tal url)" map "-tal" => :tumblr_album option :output, aliases: "-o", type: :string, desc: "Specify an output path" def tumblr_album *args puts Status.wait image = TumblrAlbum.new(args, options) image.save puts Status.saved_album(image) end desc "imgur_album URL", "Get all pictures from an Imgur album (nokaya -ial url)" map "-ial" => :imgur_album option :output, aliases: "-o", type: :string, desc: "Specify an output path" def imgur_album *args puts Status.wait image = ImgurAlbum.new(args, options) image.save puts Status.saved_album(image) end desc "flickr_album URL", "Get all pictures from a Flickr album (nokaya -fal url)" map "-fal" => :flickr_album option :output, aliases: "-o", type: :string, desc: "Specify an output path" def flickr_album *args puts Status.wait image = FlickrAlbum.new(args, options) image.save puts Status.saved_album(image) end desc "photonet URL", "Get all pictures from a Photo.net page (nokaya -pnet url)" map "-pnet" => :photonet option :output, aliases: "-o", type: :string, desc: "Specify an output path" def photonet *args puts Status.wait image = Photonet.new(args, options) image.save puts Status.saved_album(image) end desc "deviantart URL", "Get all pictures from a Deviantart gallery (nokaya -dart url)" map "-dart" => :deviantart option :output, aliases: "-o", type: :string, desc: "Specify an output path" def deviantart *args puts Status.wait image = Deviantart.new(args, options) image.save puts Status.saved_album(image) end desc "imageshack_user URL", "Get all pictures from an Imageshack user gallery (nokaya -ishu url)" map "-ishu" => :imageshack_user option :output, aliases: "-o", type: :string, desc: "Specify an output path" def imageshack_user *args puts Status.wait image = ImageshackUser.new(args, options) image.save puts Status.saved_album(image) end desc "version", "Displays version number and informations" map "-v" => :version def version puts "\nNOKAYA\n\n" puts "Version:\t#{VERSION}\n\n" puts "Changelog:\thttps://github.com/ericdke/nokaya/blob/master/CHANGELOG.md\n" puts "Help:\t\thttps://github.com/ericdke/nokaya/blob/master/README.md\n\n" end end end