File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11# encoding: utf-8
2+ require 'time'
23
34QUERY = ARGV [ 0 ] . to_s . strip
45
56require_relative "../lib/qiita"
67
78data = Qiita ::API . search ( QUERY )
9+ data . sort! { |a , b | b [ 'stock_count' ] <=> a [ 'stock_count' ] }
810
911results = [ ]
1012data . each do |q |
1113 arg = q [ 'url' ]
12- subtitle = "Stocks: " + q [ 'stock_count' ] . to_s + " LGTM: " + q [ 'lgtm_count ' ] . to_s + " Comments: " + q [ 'comment_count' ] . to_s + " Create At:" + q [ 'created_at' ]
14+ subtitle = q [ 'stock_count' ] . to_s + " Stocks, " + q [ 'comment_count ' ] . to_s + " Comments, " + Time . parse ( q [ 'created_at' ] ) . strftime ( "%Y/%m/%d %H:%M:%S" ) + " Created"
1315
1416 item = {
15- :uid => q [ 'id' ] ,
17+ :uid => nil ,
1618 :arg => arg ,
1719 :title => q [ 'title' ] ,
1820 :subtitle => subtitle ,
Original file line number Diff line number Diff line change 11# encoding: utf-8
2+ require 'time'
23
34QUERY = ARGV [ 0 ] . to_s . strip
45
1617end
1718
1819data = Qiita ::API . search ( QUERY , :token => config . token , :stocked => 1 )
20+ data . sort! { |a , b | b [ 'stock_count' ] <=> a [ 'stock_count' ] }
1921
2022results = [ ]
2123data . each do |q |
22- subtitle = "Stocks: " + q [ 'stock_count' ] . to_s + " LGTM: " + q [ 'lgtm_count ' ] . to_s + " Comments: " + q [ 'comment_count' ] . to_s + " Create At:" + q [ 'created_at' ]
24+ subtitle = q [ 'stock_count' ] . to_s + " Stocks, " + q [ 'comment_count ' ] . to_s + " Comments, " + Time . parse ( q [ 'created_at' ] ) . strftime ( "%Y/%m/%d %H:%M:%S" ) + " Created"
2325
2426 item = {
25- :uid => q [ 'id' ] ,
27+ :uid => nil ,
2628 :arg => q [ 'url' ] ,
2729 :title => q [ 'title' ] ,
2830 :subtitle => subtitle ,
You can’t perform that action at this time.
0 commit comments