File tree Expand file tree Collapse file tree
xpi/chrome/content/library Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1170,7 +1170,7 @@ Models.register(update({
11701170 ORIGIN : 'https://twitter.com' ,
11711171 ACCOUT_URL : 'https://twitter.com/settings/account' ,
11721172 TWEET_API_URL : 'https://twitter.com/i/tweet' ,
1173- UPLOAD_API_URL : 'https://upload.twitter.com/i/media/upload.iframe ' ,
1173+ UPLOAD_API_URL : 'https://upload.twitter.com/i/media/upload.json ' ,
11741174 STATUS_MAX_LENGTH : 140 ,
11751175 OPTIONS : {
11761176 // for twttr.txt.getTweetLength()
@@ -1413,17 +1413,13 @@ Models.register(update({
14131413 var bis = new BinaryInputStream ( new FileInputStream ( file , - 1 , 0 , false ) ) ;
14141414
14151415 return request ( this . UPLOAD_API_URL , {
1416- responseType : 'document ' ,
1416+ responseType : 'json ' ,
14171417 sendContent : update ( {
14181418 media : btoa ( bis . readBytes ( bis . available ( ) ) )
14191419 } , token )
14201420 } ) . addErrback ( ( ) => {
14211421 throw new Error ( getMessage ( 'message.model.twitter.upload' ) ) ;
1422- } ) . addCallback ( ( { response : doc } ) => {
1423- var json = JSON . parse ( doc . scripts [ 0 ] . textContent . extract (
1424- / p a r e n t \. p o s t M e s s a g e \( J S O N \. s t r i n g i f y \( ( \{ .+ \} ) \) , " .+ " \) ; /
1425- ) ) ;
1426-
1422+ } ) . addCallback ( ( { response : json } ) => {
14271423 return this . update ( update ( {
14281424 media_ids : json . media_id_string
14291425 } , token ) , status ) ;
You can’t perform that action at this time.
0 commit comments