Guest User

Untitled

a guest
Jan 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var startAuthor;
  2. var startPermlink;
  3.  
  4. function getDiscussions(start_author, start_permlink)
  5. {
  6.      start_author = typeof start_author !== 'undefined' ?  start_author : '';
  7.      start_permlink = typeof start_permlink !== 'undefined' ?  start_permlink : '';
  8.      if(start_permlink && start_author)
  9.      {
  10.          var params =
  11.          {
  12.              'limit': 100,
  13.              'truncate_body': 240,
  14.              'start_author': start_author,
  15.              'start_permlink': start_permlink
  16.          }    
  17.      }
  18.      else
  19.      {
  20.          var params =
  21.          {
  22.              'limit': 100,
  23.              'truncate_body': 240
  24.          }
  25.      }
  26.      
  27.      golos.api.getDiscussionsByCreated(params, function(err, data){
  28.         if(data.length > 0)
  29.         {          
  30.             data.forEach(function (operation){
  31.                 AddBlockX(operation);
  32.             });
  33.         }
  34.      });
  35. }
  36.  
  37. function AddBlockX(operation)
  38. {
  39.     ...
  40.     startAuthor = operation.author;
  41.     startPermlink = operation.permlink;
  42.     ...
  43.  
  44. }
Add Comment
Please, Sign In to add comment