title: How to do simple Facebook status post with text and picture
body: <p>I'm using the JavaScript API. I can do a simple text post with no problem:</p>
  
  <pre><code>var params = {};
  params['message'] = 'The text';
  FB.api("me/feed", 'post', params, function(response) {
     if (!response || response.error)
        alert(response.error.message);
     else
        alert('Post ID: ' + response.id);
  });
  </code></pre>
  
  <p>Adding a picture with:</p>
  
  <pre><code>params['picture'] = "http://mysite.com/link-to-picture";
  params['type'] = "photo";
  ...
  </code></pre>
  
  <p>Posts a link-type status with a garbled link, using the picture as a thumbnail.</p>
  
  <p>If I use "my/photos", it works fine the first time:</p>
  
  <pre><code>var params = {};
  params['message'] = 'The text';
  params['url'] = "http://mysite.com/link-to-picture";
  FB.api("me/photos", 'post', params, function(response) {
     if (!response || response.error)
        alert(response.error.message);
     else
        alert('Post ID: ' + response.id);
  });
  </code></pre>
  
  <p>But then if I do another post I lose the first post item from my feed, and get an album type presentation in the feed with the text from the second post, and both (unrelated) pictures</p>
  
  <p>The only way I have been able to get distinct status posts with their own text and picture is by first creating a serial numbered album, and then posting the picture to that.</p>
  
  <pre><code>var aparams = {};
  aparams['name'] = "post"+postid;
  aparams['message'] = "album for post "+postid;
  FB.api("me/albums", 'post', aparams, function(response) {
    if (!response || response.error)
    {
       alert("Creating album: "+response.error.message);
    }
    else
    {
       alert('Album ID: ' + response.id);
       var aid = response.id;
       params['url'] = "http://mysite.com/link-to-picture";
       FB.api(aid+"/photos", 'post', params, function(response) {
          if (!response || response.error)
             alert("Posting photo: "+response.error.message);
          else
             alert('Post ID: ' + response.id);
       });
    }
  });
  </code></pre>
  
  <p>That can't be the right way to do it - creating a mass of single picture albums!</p>
  
  <p>I notice that I have by default a 'Timeline Photos' album, so I could get its ID, then upload the picture to that. But then how would I do the FB.api("my/feed" ...) post with just the text and refer to the picture. I can't find anything like that in the documentation.</p>
  
  <p>My requirement seems to me to be very basic. Has anyone been able to get it right?</p>