lib/ayadn/post.rb in ayadn-1.4.2 vs lib/ayadn/post.rb in ayadn-1.4.3

- old
+ new

@@ -9,18 +9,11 @@ error_text_empty end end def compose - # case Settings.config[:platform] - # when /mswin|mingw|cygwin/ - # post = classic - # else - require "readline" - readline - # end - # post + readline() end def send_embedded text, files send_embedded_pictures({'text' => text, 'data' => FileOps.upload_files(files)}) end @@ -59,11 +52,16 @@ "type" => "photo", "width" => dic['width'], "height" => dic['height'], "title" => dic['title'], "url" => dic['artwork'], - "embeddable_url" => dic['artwork'] + "embeddable_url" => dic['artwork'], + "provider_url" => "https://itunes.apple.com", + "provider_name" => "iTunes", + "thumbnail_url" => dic['artwork_thumb'], + "thumbnail_width" => dic['width_thumb'], + "thumbnail_height" => dic['height_thumb'] } } end { "text" => dic['text'], @@ -113,23 +111,10 @@ } end return base end - # def auto_classic - # loop do - # begin - # print "#{Settings.config[:identity][:handle]} >> ".color(:red) - # t = STDIN.gets.chomp - # send_post(t) - # puts Status.done - # rescue Interrupt - # abort(Status.canceled) - # end - # end - # end - def auto_readline loop do begin #while buffer = Readline.readline("#{Settings.config[:identity][:handle]} >> ".color(:red)) while buffer = Readline.readline(">> ".color(:red)) @@ -148,20 +133,13 @@ begin while buffer = Readline.readline("> ") post << buffer end rescue Interrupt - #Errors.info "Write post: canceled." abort(Status.canceled) end post end - - # def classic - # puts Status.classic - # input_text = STDIN.gets.chomp - # [input_text] - # end def reply(new_post, replied_to) replied_to = replied_to.values[0] reply = replied_to[:handle].dup reply << " #{new_post}"