Note that there are some explanatory texts on larger screens.

plurals
  1. PODeleting a previosly posted Article with OpenGraph, or check if said Article has already been read
    text
    copied!<p>I've created a simple app for reading articles, which creates posts with the following code:</p> <pre><code> FB.api('/me/[NAMESPACE]:read&amp;article=http://example.com/article.html','post', function(response) { if (!response) { alert('Error Occurred I got no response with ' + $pageURL); } else if (response.error) { alert('Error Occurred' + response.responseText + " " + response.error.responseText); } else { alert('Post was successful! Action ID: ' + response.id); var idToDeleteLater = response.id; } }); </code></pre> <p>And I want to be able to check if the page had been visited before, so I'll be able to forbid any further creating of posts for the same article.</p> <p>But in order to do that I'd need to get the article ID, and I haven't been able to get to it with the response.id command, since that one only gives me the ID of the individual post.</p> <p>I don't want to use the given method:</p> <pre><code> function postUnreadSpecific() { var postId = idToDeleteLater; FB.api(postId, 'delete', function(response) { if (!response || response.error) { alert('Error occured'); } else { alert('Post was deleted'); } }); </code></pre> <p>Because the reading is done via a Button (same as in the tutorial with the cooking), so whenever I push the button new posts are created, with different ID's and I obviously don't wan't to type them manually.</p> <p>So, bottomline, how does one get the page ID (not the post ID with response.id), and make a check, if the page had been visited before, disable creation of new posts...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload