Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $comment_helper = null;
- $comments = [];
- $fp = fopen($_SERVER['DOCUMENT_ROOT']. "1460725204439623926.txt", "a");
- do {
- if (is_null($comment_helper)) {
- $comment_helper = $i->getMediaComments(1460725204439623926);
- } else {
- $comment_helper = $i->getMediaComments(1460725204439623926, $comment_helper->getNextMaxId());
- }
- $comments = array_merge($comments, $comment_helper->getComments());
- } while (!is_null($comment_helper->getNextMaxId()));
- foreach ($comments as $comment) {
- try {
- if(strlen($comment->text) == mb_strlen($comment->text, 'utf-8')) {
- fwrite($fp, '- '.$comment->text."\n");
- }
- }
- catch (InstagramException $ie) {
- echo $ie.getCode();
- sleep(6);
- }
- fclose($fp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement