lib/ayadn/app.rb in ayadn-1.5.1 vs lib/ayadn/app.rb in ayadn-1.6.0

- old
+ new

@@ -1,11 +1,11 @@ # encoding: utf-8 module Ayadn class App < Thor package_name "Ayadn" - %w{action api descriptions endpoints cnx view workers settings post status extend databases fileops logs pinboard set alias errors blacklist scroll authorize switch mark nicerank debug}.each { |r| require_relative "#{r}" } + %w{action stream api search descriptions endpoints cnx view workers settings post status extend databases fileops logs pinboard set alias errors blacklist scroll authorize switch mark nicerank debug check nowplaying nowwatching tvshow}.each { |r| require_relative "#{r}" } ## # These methods are intended to be called from the CLI. desc "timeline", "Show your App.net timeline, aka the Unified Stream (-tl)" @@ -240,11 +240,11 @@ end desc "delete POST", "Delete a post (-D)" map "-D" => :delete long_desc Descriptions.delete - def delete(post_id) + def delete(*post_id) Action.new.delete(post_id) end desc "delete_m CHANNEL MESSAGE", "Delete a message (-DM)" map "-DM" => :delete_m @@ -417,16 +417,35 @@ desc "blacklist COMMAND (PARAM)", "Manage your blacklist (-K)" map "-K" => :blacklist long_desc Descriptions.blacklist subcommand "blacklist", Blacklist - desc "nowplaying", "Post the current iTunes track (-np)" + desc "nowplaying", "Post the current playing track from iTunes or Last.fm (-np)" map "-np" => :nowplaying long_desc Descriptions.nowplaying option :no_url, aliases: "-n", type: :boolean, desc: "Don't append preview or album art at the end of the post" option :lastfm, aliases: "-l", type: :boolean, desc: "Get current track from Last.fm instead of iTunes" def nowplaying Action.new.nowplaying(options) + end + + desc "movie TITLE", "Create a post from a movie title (-NW)" + map "nowwatching" => :movie + map "imdb" => :movie + map "-NW" => :movie + long_desc Descriptions.nowwatching + option :alt, aliases: "-a", type: :boolean, desc: "Select an alternative response if the first didn't match" + def movie(*title) + Action.new.nowwatching(title, options) + end + + desc "tvshow TITLE", "Create a post from a TV show title (-TV)" + map "-TV" => :tvshow + long_desc Descriptions.tvshow + option :alt, aliases: "-a", type: :boolean, desc: "Select an alternative response if the first didn't match" + option :banner, aliases: "-b", type: :boolean, desc: "Inserts the show banner instead of the show poster" + def tvshow(*title) + Action.new.tvshow(title, options) end desc "random", "Show random posts from App.net (-rnd)" map "-rnd" => :random option :wait, aliases: "-w", type: :numeric, desc: "In seconds, time to wait before next page"