1919 'comment' ,
2020 'vote-gallery' ,
2121 'vote-comment' ,
22- 'add-album-image'
22+ 'add-album-image' ,
23+ 'replies'
2324]
2425
2526oauth_commands = [
@@ -130,14 +131,14 @@ def handle_authorized_commands(factory, action):
130131 print ('Comment too long (trim by %d characters).' % (len (text ) - 140 ))
131132 sys .exit (1 )
132133
133- req = factory .build_request (('gallery' , item_hash , 'comment' ), {
134+ req = factory .build_post_request (('gallery' , item_hash , 'comment' ), {
134135 'comment' : text
135136 })
136137 elif action == 'add-album-image' :
137138 album_id = sys .argv [3 ]
138139 image_ids = ',' .join (sys .argv [4 :])
139140
140- req = factory .build_request (('album' , album_id ), {
141+ req = factory .build_put_request (('album' , album_id ), {
141142 'ids[]' : image_ids
142143 }, 'PUT' )
143144
@@ -149,7 +150,9 @@ def handle_authorized_commands(factory, action):
149150 else :
150151 target = ('comment' , target_id , 'vote' , vote )
151152
152- req = factory .build_request (target , "" )
153+ req = factory .build_get_request (target , "" )
154+ elif action == 'replies' :
155+ req = factory .build_get_request (('account' , 'me' , 'notifications' , 'replies' ), {'new' : 'false' })
153156
154157 try :
155158 res = imgur .retrieve (req )
@@ -169,7 +172,7 @@ def handle_oauth_commands(factory, config, action):
169172 imgur = factory .build_api ()
170173
171174 if action == 'credits' :
172- req = factory .build_request (('credits' ,))
175+ req = factory .build_get_request (('credits' ,))
173176 res = imgur .retrieve (req )
174177 print (res )
175178 elif action == 'refresh' :
@@ -222,19 +225,19 @@ def handle_unauthorized_commands(factory, action):
222225 else :
223226 if action == 'list-comments' :
224227 item_hash = sys .argv [2 ]
225- req = factory .build_request (('gallery' , item_hash , 'comments' ))
228+ req = factory .build_get_request (('gallery' , item_hash , 'comments' ))
226229
227230 if action == 'get-album' :
228231 id = sys .argv [2 ]
229- req = factory .build_request (('album' , id ))
232+ req = factory .build_get_request (('album' , id ))
230233
231234 if action == 'get-comment' :
232235 cid = sys .argv [2 ]
233- req = factory .build_request (('comment' , cid ))
236+ req = factory .build_get_request (('comment' , cid ))
234237
235238 if action == 'get-gallery' :
236239 id = sys .argv [2 ]
237- req = factory .build_request (('gallery' , id ))
240+ req = factory .build_get_request (('gallery' , id ))
238241
239242 res = imgur .retrieve (req )
240243 print (res )
0 commit comments