Attempting to write a script that'll fetch a couple users' latest tweets. Works great on my own twitter account, but not on the other accounts, which were created very recently (< 7 days).
Upon checking their account settings, they report that "Protect my tweets" is unchecked, which should mean that I can access them publicaly using the twitter API.
Relevant code:
$url = 'http://api.twitter.com/1/statuses/user_timeline.json?user_id=' . $twID . '&count=' . $count . '&trim_user=true';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$return[] = json_decode(curl_exec($ch), true);
Result from Twitter API:
[0] => Array
(
[error] => This method requires authentication.
[request] => /1/statuses/user_timeline.json?user_id=1540067663&count=6&trim_user=true
)
[1] => Array
(
[0] => Array
(
[favorited] => ... // Success -- Output truncated for brevity.
)
[2] => Array
(
[error] => This method requires authentication.
[request] => /1/statuses/user_timeline.json?user_id=1532872753&count=6&trim_user=true
)
)
Are new accounts automatically protected in the Twitter API?