freak Posted November 1, 2011 Report Share Posted November 1, 2011 (edited) Vai ir te kāds , kas ir saskāries ar odnoklassniki API? Nekādīgi nestrādā publicēšana strīmā (runā). It kā viss notiek, tikai nekas neparādās pie tekstiem. Javascript kods: <script type="text/javascript" charset="utf-8"> FAPI.init('http://api.odnoklassniki.ru/', key, function() { //success FAPI.UI.initialize(); }, function(error){ alert("API initialization failed"); }); var viral_post_to_stream = {}; function viral_post() { viral_post_to_stream = { "method" : "stream.publish", "message" : text.', "action_links" : '[{"text":"text.","href":"from=stream_global"}]', "application_key" : FAPI.UI.applicationKey, "session_key" : FAPI.UI.sessionKey, "format" : FAPI.UI.format, "attachment": '{"caption":"text", "media":[{"href":"link","src":"/images/app_icons/v2/128x128.jpg","type":"image"}]}' }; var sig = FAPI.Util.calcSignature(viral_post_to_stream, FAPI.UI.sessionSecretKey); FAPI.UI.showConfirmation( "stream.publish", 'test.', sig ); } // CALLBACK for stream.publish function API_callback(method, status, attributes) { if(method == 'showConfirmation' && status == 'ok') { viral_post_to_stream["resig"] = attributes; FAPI.UI.call( viral_post_to_stream, function(status2, data2, error2) { } ); } } </script> Edited November 1, 2011 by freak Quote Link to comment Share on other sites More sharing options...
0 e-remit Posted July 13, 2012 Report Share Posted July 13, 2012 Tā kā nācās pašam iet cauri šai problēmai, ja kādam vēl ievajagas, vēsturei pieliku pašlaik strādājošo versiju: <script type="text/javascript" charset="utf-8"> FAPI.init('http://api.odnoklassniki.ru/', key, function() { //success FAPI.UI.initialize(); }, function(error){ alert("API initialization failed"); }); var viral_post_to_stream = {}; function viral_post(postText) { viral_post_to_stream = { "method" : "stream.publish", "message" : postText, "action_links" : '[{"text":"text.","href":"frompublished"}]', "attachment": '{"caption":"text", "media":[{"href":"link","src":"/images/app_icons/v2/128x128.jpg","type":"image"}]}' }; var sig = FAPI.Client.calcSignature(viral_post_to_stream); FAPI.UI.showConfirmation("stream.publish", postText, sig); } // CALLBACK for stream.publish function API_callback(method, status, attributes) { if(method == 'showConfirmation' && status == 'ok') { FAPI.UI.call( viral_post_to_stream, function(status2, data2, error2) { }, attributes ); } } </script> Quote Link to comment Share on other sites More sharing options...
Question
freak
Vai ir te kāds , kas ir saskāries ar odnoklassniki API?
Nekādīgi nestrādā publicēšana strīmā (runā). It kā viss notiek, tikai nekas neparādās pie tekstiem.
Javascript kods:
Edited by freakLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.