Typecast long id to int will cause issue.
Typecast long id to int will cause issue.

The current pintrest id's having length like this one
(641763084339350760). The typecastign will lead this number to
2147483647 as this is max valie of integer type.
So removed typecasting.

You can check following php code for reference
<?php
$number = '641763084339350760';
echo $number.'<br/>';
echo (int)$number.'<br/>';
?>

hansott/pinterest-php